Re: ISSTRICT behavior

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ISSTRICT behavior
Дата
Msg-id 19377.1146722960@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ISSTRICT behavior  (Don Y <pgsql@DakotaCom.Net>)
Ответы Re: ISSTRICT behavior  (Don Y <pgsql@DakotaCom.Net>)
Список pgsql-general
Don Y <pgsql@DakotaCom.Net> writes:
> Is there any way of mimicking the IS STRICT behavior
> *without* declaring the function as "STRICT"?

Are you looking for PG_RETURN_NULL()?  If not, this seems a bit
nonsensical.

> Lastly, am I correct in assuming that the STRICT
> modifier only protect a function from being invoked
> with a NULL _from_the_SQL_interface?  I.e. does it
> also protect the function from being invoked from
> PL/pgsql?  (I'm sure it does NOT protect from a
> deliberate invocation from a C language function, etc.)

If a caller fails to check this (directly or indirectly),
it's the caller's bug not the callee's.  To say otherwise
would require introducing ARGISNULL checks into literally
thousands of places.  There are far fewer call sites of
arbitrary functions, so we put the burden on the callers.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Don Y
Дата:
Сообщение: ISSTRICT behavior
Следующее
От:
Дата:
Сообщение: RES: pg_dumpall error