Re: [INTERFACES] selectecting not null varchars. - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] selectecting not null varchars.
Date
Msg-id 23137.951431026@sss.pgh.pa.us
Whole thread Raw
In response to selectecting not null varchars.  (Joseph Shraibman <jks@p1.selectacast.net>)
List pgsql-interfaces
Joseph Shraibman <jks@p1.selectacast.net> writes:
> select * from directory where h != null AND length(h) > 0 ;

The correct, SQL92-approved spelling for this condition is
WHERE h IS NOT NULL AND ...

We also accept the abbreviation "h NOTNULL", although that's not a
standard AFAIK.  And of course you could do "NOT(h IS NULL)".

Certain Microsoft products that have difficulty grasping the concept of
NULL allow you to write these conditions with "=" or "!=", but in fact
any ordinary comparison operator should yield NULL out if either input
is NULL, so Microsoft is violating the letter and spirit of the spec by
accepting that.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: [INTERFACES] selectecting not null varchars.
Next
From: Ed Loehr
Date:
Subject: Re: [INTERFACES] selectecting not null varchars.