Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e6H6R4088236 for ; Mon, 17 Jul 2000 02:27:04 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id CAA28632; Mon, 17 Jul 2000 02:26:32 -0400 (EDT) To: Thomas Lockhart cc: Philip Warner , Carolyn Lu Wong , "pgsql-sql@postgresql.org" Subject: Re: SQL question In-reply-to: <3972A65A.FBC3E35D@alumni.caltech.edu> References: <3.0.5.32.20000717121856.022cd100@mail.rhyme.com.au> <3.0.5.32.20000717141152.022dd100@mail.rhyme.com.au> <28464.963812928@sss.pgh.pa.us> <3972A65A.FBC3E35D@alumni.caltech.edu> Comments: In-reply-to Thomas Lockhart message dated "Mon, 17 Jul 2000 06:23:22 -0000" Date: Mon, 17 Jul 2000 02:26:31 -0400 Message-ID: <28629.963815191@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/167 Thomas Lockhart writes: >> The immediate cause of this gripe was discussed just a day or so ago >> on one or another of the pgsql lists. The timestamp-to-date conversion >> routine has this weird idea that it should kick out an error instead >> of returning NULL when presented with a NULL timestamp. That's a bug >> IMHO, and I've already changed the code in current sources. > That's not a bug, that was a feature, sort of. At least when I coded it, > Postgres *refused* to call any routine with NULL input, assuming that > NULL would be returned. Well before my time, I guess --- as long as I've been paying attention, the function manager's approach was to call the routine first and *then* insert a NULL result ... if the routine hadn't crashed first. That's about as braindead a choice as I can think of, but that's what it did. > A clever short-circuit, and the elog(ERROR) in > the conversion routine was just a safety net. Because it was also the > case that any routine returning a NULL pointer crashed the backend. > Now that those things aren't true, we are rewriting history to say that > they were bugs all along, eh? ;) Fixing that one routine to behave that way, when none of the hundreds of others that might see a NULL input do the same, qualifies as a bug IMHO. But it's all water over the dam, now that fmgr has been redesigned. regards, tom lane