From: Tom Lane <tgl@sss.pgh.pa.us>
To: bsmith@h-e.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Odd behavior with NULL value
Date: Thu, 20 Dec 2001 23:40:59 -0500
Message-ID: <16208.1008909659@sss.pgh.pa.us> (raw)
In-Reply-To: <000001411913091751151@h-e.com>
References: <000001411913091751151@h-e.com>
bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.) writes:
> Here is the problem I'm trying to solve, perhaps someone can help.
> For an invoicing system database, I have a table that defines
> employees. Each has a begin and end date defining the employment
> period. For current employees, the end date is "open". How do I
> express that to keep queries as simple as possible?
NULL seems like the most obvious and portable answer, though you might
have to phrase queries carefully to make it work. Another possibility
is to use timestamp rather than date, so you could use "+infinity" for
the end date of active employees.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, bsmith@h-e.com
Subject: Re: Odd behavior with NULL value
In-Reply-To: <16208.1008909659@sss.pgh.pa.us>
References: <000001411913091751151@h-e.com> <16208.1008909659@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox