Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id ECC3647749F for ; Fri, 27 Sep 2002 08:52:44 -0400 (EDT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id C369D4774D8 for ; Fri, 27 Sep 2002 08:44:47 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 17uuUE-0006t6-0U; Fri, 27 Sep 2002 13:44:50 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id AE092163D4; Fri, 27 Sep 2002 13:36:55 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id EE4DF163BB; Fri, 27 Sep 2002 13:36:54 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Ajit Aranha , pgsql-sql@postgresql.org Subject: Re: Null not equal to '' (empty) Date: Fri, 27 Sep 2002 13:36:03 +0100 User-Agent: KMail/1.4.3 References: <20020920060916.42881.qmail@web14104.mail.yahoo.com> In-Reply-To: <20020920060916.42881.qmail@web14104.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200209271336.03193.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/376 X-Sequence-Number: 9653 On Friday 20 Sep 2002 7:09 am, Ajit Aranha wrote: > Why is ''(empty) not equal to null? Its a major headache when porting > from other RDBMS like Oracle. Anyone knows any easy workarounds? By definition it is different - null means "not known" or "no value" not em= pty=20 string. Do you think it should be zero for numbers? > i.e. if you use: create table tbl ( > c1 varchar(5)); > insert into tbl values (''); > select * from tbl where c1 is null; will return > zero rows. Yep - that's the way it should be. If you want empty-strings, ask for them.= If=20 you don't want to allow null values in a column define it as NOT NULL. - Richard Huxton