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

RE: comparing rows

From: Magnus Hagander <mha(at)sollentuna(dot)net>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: comparing rows
Date: 2000-08-03 14:10:06
Message-ID: 215896B6B5E1CF11BC5600805FFEA82103D97AA9@sirius.edu.sollentuna.se (view raw or flat)
Thread:
Lists: pgsql-hackers
> > Summary of MS:
> > When it runs in ANSI mode, null != null.
> > When it runs in backwards compatible mode , null=null.
> 
> Oh, that's interesting, they fixed their bug.
> 
> foo = NULL should produce NULL (*not* true, and *not* false either,
> though it'd act like false in a CASE test).

Hmm. I think I can answer my own question by using the dreaded manual. This
is what Books On-Line for MS has to say:

"
The result of a comparison operator has the Boolean data type, which has
three values: TRUE, FALSE, and UNKNOWN. Expressions that return a Boolean
data type are known as Boolean expressions.

Unlike other SQL Server data types, a Boolean data type cannot be specified
as the data type of a table column or variable, and cannot be returned in a
result set.

When SET ANSI_NULLS is ON, an operator that has one or two NULL expressions
returns UNKNOWN. When SET ANSI_NULLS is OFF, the same rules apply, except an
equals operator returns TRUE if both expressions are NULL. For example, NULL
= NULL returns TRUE if SET ANSI_NULLS is OFF.
"

So apparantly:
a) I can't check it :-)
b) It does return UNKNOWN (NULL?) for <anything>=NULL


//Magnus

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-08-03 14:22:37
Subject: Re: comparing rows
Previous:From: Tom LaneDate: 2000-08-03 14:07:24
Subject: Re: comparing rows

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