Re: creating a function returning FALSE on NULL input ? - Mailing list pgsql-general

From Tom Lane
Subject Re: creating a function returning FALSE on NULL input ?
Date
Msg-id 1110.1352273072@sss.pgh.pa.us
Whole thread Raw
In response to creating a function returning FALSE on NULL input ?  (Yvon Thoraval <yvon.thoraval@gmail.com>)
List pgsql-general
Yvon Thoraval <yvon.thoraval@gmail.com> 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


pgsql-general by date:

Previous
From: Yvon Thoraval
Date:
Subject: Re: creating a function returning FALSE on NULL input ?
Next
From: Tianyin Xu
Date:
Subject: The bug reporting form are unavailable