Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA16047 for ; Mon, 15 Nov 1999 10:43:17 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA18522; Mon, 15 Nov 1999 10:41:46 -0500 (EST) To: Thomas Lockhart cc: Gary MacMinn , pgsql-sql@postgreSQL.org Subject: Re: [SQL] nulls and datetime In-reply-to: Your message of Mon, 15 Nov 1999 15:29:43 +0000 <383026E7.11E9B7A1@alumni.caltech.edu> Date: Mon, 15 Nov 1999 10:41:45 -0500 Message-ID: <18520.942680505@sss.pgh.pa.us> From: Tom Lane Thomas Lockhart 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