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@{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.