Received: from sss.pgh.pa.us ([216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3DIcq896118 for ; Fri, 13 Apr 2001 14:38:52 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3DIcmR05200; Fri, 13 Apr 2001 14:38:49 -0400 (EDT) To: Jeff Eckermann cc: pgsql-sql@postgresql.org Subject: Re: RE: RE: Re: select substr??? In-reply-to: <08CD1781F85AD4118E0800A0C9B8580B094A18@NEZU> References: <08CD1781F85AD4118E0800A0C9B8580B094A18@NEZU> Comments: In-reply-to Jeff Eckermann message dated "Thu, 12 Apr 2001 14:04:54 -0500" Date: Fri, 13 Apr 2001 14:38:48 -0400 Message-ID: <5197.987187128@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/205 X-Sequence-Number: 2555 Jeff Eckermann 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