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

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: jwieck(at)debis(dot)com
Cc: taral(at)mail(dot)utexas(dot)edu, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] A small problem with the new inet and cidr typesg
Date: 1998-11-03 14:06:38
Message-ID: m0zah6U-0000eRC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thus spake Jan Wieck
> D'Arcy J.M. Cain wrote:
> > There may be cases where a function of a null is not null as some people
> > have pointed out but so far no one has come up with a practical example.
>
> CREATE FUNCTION cnt_t1_b(text) RETURNS int4 AS
> 'SELECT count(*) FROM t1 WHERE b = $1'
> LANGUAGE 'sql';
>
> BTW: It does not work with NULL argument currently, but IMHO
> it should count the number of rows where b is NULL.

Well, this is the first example that I have seen that wouldn't work
unless a function with a null argument actually called the function but
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.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1998-11-03 15:35:22 Re: [HACKERS] A small problem with the new inet and cidr types
Previous Message D'Arcy J.M. Cain 1998-11-03 13:53:16 Re: [HACKERS] A small problem with the new inet and cidr types