Re: ISSTRICT behavior

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Don Y <pgsql(at)DakotaCom(dot)Net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ISSTRICT behavior
Date: 2006-05-04 06:09:20
Message-ID: 19377.1146722960@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Don Y <pgsql(at)DakotaCom(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message carlosreimer 2006-05-04 06:29:41 RES: pg_dumpall error
Previous Message Don Y 2006-05-04 06:02:26 ISSTRICT behavior