Received: from home.c0de.net (209.dsl6660135.nokia.surewest.net [66.60.135.209]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBL1MSm64066 for ; Thu, 20 Dec 2001 20:22:33 -0500 (EST) (envelope-from phill@home.c0de.net) Received: from phill by home.c0de.net with local (Exim 3.33 #1 (Debian)) id 16HEOR-0007z9-00; Thu, 20 Dec 2001 17:22:35 -0800 Date: Thu, 20 Dec 2001 17:22:35 -0800 From: Phill Kenoyer To: "Bob Smith, Hammett & Edison, Inc." Cc: pgsql-admin@postgresql.org Subject: Re: Odd behavior with NULL value Message-ID: <20011221012235.GW19766@c0de.net> References: <000001411043091739073@h-e.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001411043091739073@h-e.com> User-Agent: Mutt/1.3.24i X-Archive-Number: 200112/146 X-Sequence-Number: 2869 I think that this page will explain it all: http://www.postgresql.org/idocs/index.php?functions-comparison.html |On 011220 17:05 |Bob Smith, Hammett & Edison, Inc. (bsmith@h-e.com) wrote the following... | |See example below of using NULL values with type DATE. It behaves |strangely in expressions, "(x <> null)" gives an entirely different |result than "not(x = null)". Is this intended behavior, if so, why? |If not, is this a bug? | |On a related note, does anyone know if 'current' works with DATE? With |TIMESTAMP it always evaluates to the time as of the retrieval of the |value, not as of the insertion, but for DATE it looks like it gets |evaluated at insertion (I can't tell for sure from my test db for another |8 hours or so, I could just roll the date forward on the server, but I'd |like to keep my job...) | |Thanks to anyone who can shed some light on this! | |rsj=> \d test | Table "test" | Attribute | Type | Modifier |-----------+---------+---------- | key | integer | | date | date | | |rsj=> select * from test; | key | date |-----+------------ | 1 | 2001-12-20 | 2 | 2001-12-20 | 3 | |(3 rows) | |rsj=> select * from test where date = null; | key | date |-----+------ | 3 | |(1 row) | |rsj=> select * from test where date <> null; | key | date |-----+------ |(0 rows) | |rsj=> select * from test where not(date = null); | key | date |-----+------------ | 1 | 2001-12-20 | 2 | 2001-12-20 |(2 rows) -- Reason: Typo in the code _ | _ (_()(|('.|)('||.|()|`|(