Re: ISSTRICT behavior - Mailing list pgsql-general

From Tom Lane
Subject Re: ISSTRICT behavior
Date
Msg-id 19377.1146722960@sss.pgh.pa.us
Whole thread Raw
In response to ISSTRICT behavior  (Don Y <pgsql@DakotaCom.Net>)
Responses Re: ISSTRICT behavior  (Don Y <pgsql@DakotaCom.Net>)
List 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 by date:

Previous
From: Don Y
Date:
Subject: ISSTRICT behavior
Next
From:
Date:
Subject: RES: pg_dumpall error