Re: Odd behavior with NULL value - Mailing list pgsql-admin

From Tom Lane
Subject Re: Odd behavior with NULL value
Date
Msg-id 16208.1008909659@sss.pgh.pa.us
Whole thread Raw
In response to Re: Odd behavior with NULL value  (bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.))
List pgsql-admin
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

pgsql-admin by date:

Previous
From: bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.)
Date:
Subject: Re: Odd behavior with NULL value
Next
From: Bill Cunningham
Date:
Subject: Re: Odd behavior with NULL value