Search Postgresql Archives

Re: creating a function returning FALSE on NULL input ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yvon Thoraval <yvon.thoraval@xxxxxxxxx> writes:
> CREATE FUNCTION has_infos(text) RETURNS boolean AS 'select
> character_length($1) > 0;' LANGUAGE SQL IMMUTABLE RETURNS FALSE ON NULL
> INPUT;

FWIW, "RETURNS NULL ON NULL INPUT" is a formulaic phrase specified
in the SQL standard.  It's not meant to be something you can plug an
arbitrary value into --- it has to be written exactly that way.
The traditional Postgres term is just "STRICT", which means precisely
the same thing.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux