pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Lockhart <lockhart@alumni.caltech.edu>
Cc: Gary MacMinn <G.MacMinn@nca.gov.au>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] nulls and datetime
Date: Mon, 15 Nov 1999 10:41:45 -0500
Message-ID: <18520.942680505@sss.pgh.pa.us> (raw)
In-Reply-To: <383026E7.11E9B7A1@alumni.caltech.edu>

Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> In previous versions, single-argument functions with NULL input were
> short-circuited in fmgr (??) and never actually were called.

As long as I've been paying attention (which is only since 6.4 or so),
execQual+fmgr will call the function regardless of the NULL status of
the inputs.  But the NULL flag for the output is taken to be the OR of
the input NULL flags --- so you can't return anything but NULL for a
NULL input, yet the function code is run anyway.

(Actually, a single-argument function is passed the isNull pointer as
an undocumented second argument, so it's possible for such a function
to clear isNull and thus return non-NULL for NULL input.  ISNULL and
ISNOTNULL work that way, but I haven't seen anything else that uses it.)

This is an incredibly ugly set of kluges, of course, and I'm hoping
to get it cleaned up for 7.0.  See my past memos to pg-hackers on fmgr
redesign.

> Seems to me that NULL in should produce NULL out, which was the old
> behavior. I'll add this to my ToDo, unless someone else has already
> picked it up.

If you don't fix it sooner, I will change it when I pass through that
code doing the fmgr interface changes...

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <18520.942680505@sss.pgh.pa.us>
Permalink:  ../18520.942680505@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18520.942680505@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, lockhart@alumni.caltech.edu, G.MacMinn@nca.gov.au
  Subject: Re: [SQL] nulls and datetime
  In-Reply-To: <18520.942680505@sss.pgh.pa.us>
  References: <383026E7.11E9B7A1@alumni.caltech.edu> <18520.942680505@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