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: Philip Warner <pjw@rhyme.com.au>
Cc: Carolyn Lu Wong <carolyn@kss.net.au>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: SQL question
Date: Mon, 17 Jul 2000 02:26:31 -0400
Message-ID: <28629.963815191@sss.pgh.pa.us> (raw)
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>

Thomas Lockhart <lockhart@alumni.caltech.edu> 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



view thread (19+ messages)  latest in thread

Message-ID: <28629.963815191@sss.pgh.pa.us>
Permalink:  ../28629.963815191@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28629.963815191@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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lockhart@alumni.caltech.edu, pjw@rhyme.com.au, carolyn@kss.net.au
  Subject: Re: SQL question
  In-Reply-To: <28629.963815191@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