Re: [HACKERS] A small problem with the new inet and cidr typesg

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] A small problem with the new inet and cidr typesg
Date: 1998-11-03 15:46:14
Message-ID: 6914.910107974@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

darcy(at)druid(dot)net (D'Arcy J.M. Cain) writes:
> you do realize that this wouldn't work anyway, right? The following
> is a parse error.

> SELECT count(*) FROM t1 WHERE b = null;

> Mind you, I think that's a weakness but I don't know what the issues
> are with respect to the code or the standard.

I believe the accepted spelling of that query is

SELECT count(*) FROM t1 WHERE b IS NULL;

(or IS NOT NULL). I don't know either what the SQL standard has to say
about the issue --- does it expect "= NULL" to be a synonym for "IS NULL"?

The CREATE FUNCTION example does seem to illustrate that it'd be nice
if "=" and "!=" worked on NULL values. I'd still object to trying
to define an order that includes NULL, so "3 < NULL" should return NULL,
but I can see the reasonableness of defining "3 != NULL" as TRUE.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-11-03 16:38:03 Re: [HACKERS] A small problem with the new inet and cidr types
Previous Message Tom Lane 1998-11-03 15:35:22 Re: [HACKERS] A small problem with the new inet and cidr types