Re: creating a function returning FALSE on NULL input ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: creating a function returning FALSE on NULL input ?
Дата
Msg-id 1110.1352273072@sss.pgh.pa.us
обсуждение исходный текст
Ответ на creating a function returning FALSE on NULL input ?  (Yvon Thoraval <yvon.thoraval@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Yvon Thoraval
Дата:
Сообщение: Re: creating a function returning FALSE on NULL input ?
Следующее
От: Tianyin Xu
Дата:
Сообщение: The bug reporting form are unavailable