Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBL4eum90519 for ; Thu, 20 Dec 2001 23:40:57 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fBL4exi16211; Thu, 20 Dec 2001 23:40:59 -0500 (EST) To: bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.) cc: pgsql-admin@postgresql.org Subject: Re: Odd behavior with NULL value In-reply-to: <000001411913091751151@h-e.com> References: <000001411913091751151@h-e.com> Comments: In-reply-to bsmith@h-e.com (Bob Smith, Hammett & Edison, Inc.) message dated "Thu, 20 Dec 2001 19:45:51 -0800" Date: Thu, 20 Dec 2001 23:40:59 -0500 Message-ID: <16208.1008909659@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/150 X-Sequence-Number: 2873 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