pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Eckermann <jeckermann@verio.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: RE: RE: Re: select substr???
Date: Fri, 13 Apr 2001 14:38:48 -0400
Message-ID: <5197.987187128@sss.pgh.pa.us> (raw)
In-Reply-To: <08CD1781F85AD4118E0800A0C9B8580B094A18@NEZU>
References: <08CD1781F85AD4118E0800A0C9B8580B094A18@NEZU>

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



view thread (8+ messages)

Message-ID: <5197.987187128@sss.pgh.pa.us>
Permalink:  ../5197.987187128@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5197.987187128@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeckermann@verio.net
  Subject: Re: select substr???
  In-Reply-To: <5197.987187128@sss.pgh.pa.us>
  References: <08CD1781F85AD4118E0800A0C9B8580B094A18@NEZU> <5197.987187128@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox