X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1B431D7B83 for ; Sat, 27 Aug 2005 10:56:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39287-03 for ; Sat, 27 Aug 2005 13:56:47 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id 035E9D7AA4 for ; Sat, 27 Aug 2005 10:56:46 -0300 (ADT) Received: (qmail 2184 invoked by uid 500); 27 Aug 2005 13:56:29 -0000 Date: Sat, 27 Aug 2005 08:56:29 -0500 From: Bruno Wolff III To: Chris Travers Cc: "Matt L." , pgsql-sql@postgresql.org Subject: Re: nullif('','') on insert Message-ID: <20050827135629.GA1965@wolff.to> Mail-Followup-To: Bruno Wolff III , Chris Travers , "Matt L." , pgsql-sql@postgresql.org References: <20050821014023.92296.qmail@web35209.mail.mud.yahoo.com> <43100C05.7020309@travelamericas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43100C05.7020309@travelamericas.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.109 required=5 tests=[AWL=-0.098, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200508/262 X-Sequence-Number: 22490 > Your problem is that NULL's are typed in PostgreSQL. > > Try this: > > SELECT NULL; > SELECT NULL::BOOL; > SELECT NULL::BOOL::TEXT; > > to see what I mean. This is an exact illustration of your problem. Note that in 8.1 he will be able to do: SELECT NULL::TEXT::INT::BOOL and get the conversion he wants as long as he sticks to using 0 and 1 to code for false and true.