Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5CGa9E42607 for ; Tue, 12 Jun 2001 12:36:09 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from smtpsrv0.isis.unc.edu (smtpsrv0.isis.unc.edu [152.2.1.139]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f57ExJE54035; Thu, 7 Jun 2001 10:59:19 -0400 (EDT) (envelope-from aperrin@email.unc.edu) Received: from sunny.isis.unc.edu (sunny.isis.unc.edu [152.2.1.65]) by smtpsrv0.isis.unc.edu (8.9.3/8.9.1) with ESMTP id KAA05403; Thu, 7 Jun 2001 10:59:09 -0400 (EDT) Received: (from aperrin@localhost) by sunny.isis.unc.edu (8.9.3/8.9.3) id KAA13283; Thu, 7 Jun 2001 10:59:11 -0400 (EDT) Date: Thu, 7 Jun 2001 10:59:06 -0400 (EDT) From: ANDREW PERRIN X-Sender: aperrin@sunny To: Mark Stosberg cc: Stephan Szabo , Tom Lane , pgsql-sql@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: behavior of ' = NULL' vs. MySQL vs. Standards In-Reply-To: <3B1F9266.EEE2D1F0@summersault.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200106/183 X-Sequence-Number: 3417 Interesting - my experience is that Access, at least, generally treats NULL's correctly: (This was done under Access 2000): create table foo (name text(20)) insert into foo values ("bar"); insert into foo values ("bar"); insert into foo values ("bar"); insert into foo values ("bar"); insert into foo values (NULL); insert into foo values (NULL); insert into foo values (NULL); insert into foo values (NULL); select count(*) from foo where name=NULL; returns 0 select count(*) from foo where name is null; returns 4 select count(*) from foo where name <> "bar"; returns 0 Cheers, Andy --------------------------------------------------------- Andrew J. Perrin - Assistant Professor of Sociology University of North Carolina, Chapel Hill 269 Hamilton Hall CB#3210, Chapel Hill, NC 27599-3210 USA andrew_perrin@unc.edu - http://www.unc.edu/~aperrin On Thu, 7 Jun 2001, Mark Stosberg wrote: > Stephan Szabo wrote: > > > > On Wed, 6 Jun 2001, Tom Lane wrote: > > > > > Stephan Szabo writes: > > > > Yes, column = NULL should *never* return true according to the spec (it > > > > should always return NULL in fact as stated). The reason for breaking > > > > with the spec is AFAIK to work with broken microsoft clients that seem to > > > > think that =NULL is a meaningful test and generate queries using that. > > > I'd rather have the default be the spec correct behavior > > and let people configure their server to follow the misinterpretation. > > I like that idea as well. Someone like me who didn't know that this > feature was in there for M$ could have assumed it _was_ standard > behavior, and started using it as a habit. Then when I started porting > my code to another database, I'd have an extra surprise in for me. :) > > Rather than being an option targeted at just this piece of grammer, > perhaps it could a piece of a potentially larger option of "stricter > standards compliance." I realize there are a number of useful extensions > to the SQL standard in Postgres (which I like and use.), but it seems > like there would be uses for minimizing non-standard behavior, as well. > > Thank you all for your contributions to Postgres-- I use it everyday. :) > > -mark > > http://mark.stosberg.com/ > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >