Skip site navigation (1) Skip section navigation (2)

Null comparisons (was Re: checksum)

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Mike Rylander <mrylander(at)gmail(dot)com>
Cc: David Helgason <david(at)uti(dot)is>,Federico Balbi <fbalbi(at)cs(dot)utsa(dot)edu>,postgresql-general <pgsql-general(at)postgresql(dot)org>
Subject: Null comparisons (was Re: checksum)
Date: 2004-09-27 14:47:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Mon, 27 Sep 2004, Mike Rylander wrote:

> On Sun, 26 Sep 2004 20:16:52 +0200, David Helgason <david(at)uti(dot)is> wrote:

> > On a similar note, I've found myself wanting an extended '=' operator
> > meaning
> >         (a = b or (a is null and b is null))
> >
> Setting 'transform_null_equals' to true in postgresql.conf should do
> what you want.

Unfortunately, it probably won't.  That only changes the explicit token
sequence = NULL into an IS NULL, it won't help if you're doing a=b where a
or b may be NULL.

The original does appear to be equivalent to "not(a is distinct from b)",
although I'm not sure that's necessarily easier to use than the above.

In response to


pgsql-general by date

Next:From: Greg StarkDate: 2004-09-27 15:17:38
Subject: Re: Null comparisons (was Re: checksum)
Previous:From: Andrew SullivanDate: 2004-09-27 14:38:14
Subject: Re: core dump on select

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group