Re: RE: RE: Re: select substr??? - Mailing list pgsql-sql

From Tom Lane
Subject Re: RE: RE: Re: select substr???
Date
Msg-id 5197.987187128@sss.pgh.pa.us
Whole thread Raw
In response to RE: RE: Re: select substr???  (Jeff Eckermann <jeckermann@verio.net>)
List pgsql-sql
Jeff Eckermann <jeckermann@verio.net> writes:
> You are correct, the check for "$1 is null" is not required.  I was
> attempting an optimisation, as in "don't do anything else if this is null".
> The gain would depend on how much further processing the function would
> attempt before recognizing that it was dealing with a null value, which is
> something that I don't know enough to tell.

In 7.1, checking for null would be appropriate unless you've declared
the function "strict".  A strict function won't even be called for null
input, rather a null result will be assumed automatically --- with much
less overhead than an explicit test for null would need.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Mailing list gripes (was Re: Re: Maybe a Bug, maybe bad SQL)
Next
From: Tom Lane
Date:
Subject: Re: Calling plSQL functions