Re: Odd behavior with NULL value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bsmith(at)h-e(dot)com (Bob Smith, Hammett & Edison, Inc(dot))
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Odd behavior with NULL value
Date: 2001-12-21 04:40:59
Message-ID: 16208.1008909659@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

bsmith(at)h-e(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bill Cunningham 2001-12-21 05:20:56 Re: Odd behavior with NULL value
Previous Message Bob Smith, Hammett & Edison, Inc. 2001-12-21 03:45:51 Re: Odd behavior with NULL value