Re: ISSTRICT behavior - Mailing list pgsql-general

From Tom Lane
Subject Re: ISSTRICT behavior
Date
Msg-id 19686.1146725282@sss.pgh.pa.us
Whole thread Raw
In response to Re: ISSTRICT behavior  (Don Y <pgsql@DakotaCom.Net>)
Responses Re: ISSTRICT behavior
List pgsql-general
Don Y <pgsql@DakotaCom.Net> writes:
> First, if the function is defined to return an INT16,
> then returning a NULL doesn't make any sense -- since the
> caller doesn't know how to deal with a NULL (it expects
> an INT16, for example).

Really?  That would be a caller bug, if it's calling a function
that might return NULL.

> What I am trying to do is make functions more robust.
> As it stands currently, the functions get written and
> compiled "once".  Thereafter, someone can FAIL to
> specify STRICT when creating those functions in SQL
> (CREATE FUNCTION...) and leave the server vulnerable
> to having those functions invoked with NULL arguments.

This would be the error of the person specifying the function's
SQL definition.  Since there are many ways to crash the system by
writing a C function definition wrongly (eg, give the wrong
datatypes), I can't get very excited about this particular one.
We do make this a superuser-only feature for a reason: you're
expected to be competent enough to get it right.

            regards, tom lane

pgsql-general by date:

Previous
From: Don Y
Date:
Subject: Re: ISSTRICT behavior
Next
From: Tom Lane
Date:
Subject: Re: ISSTRICT behavior