pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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 01:48:48 -0400
Message-ID: <28464.963812928@sss.pgh.pa.us> (raw)
In-Reply-To: <3.0.5.32.20000717141152.022dd100@mail.rhyme.com.au>
References: <3.0.5.32.20000717121856.022cd100@mail.rhyme.com.au>
	<3.0.5.32.20000717141152.022dd100@mail.rhyme.com.au>

Philip Warner <pjw@rhyme.com.au> writes:
> Another alternative would be to define a 'coalesce' function (I don't think
> PG has one), which takes an arbitrary number of arguments and returns the
> first non-null one.

We surely do have that!  It even works pretty well in 7.0 ;-)
(I think there were still some bugs lurking in 6.5.)

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.

COALESCE would be a good workaround if you don't want to patch your
local copy of 7.0.*.

			regards, tom lane



view thread (19+ messages)  latest in thread

Message-ID: <28464.963812928@sss.pgh.pa.us>
Permalink:  ../28464.963812928@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28464.963812928@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, pjw@rhyme.com.au, carolyn@kss.net.au
  Subject: Re: SQL question
  In-Reply-To: <28464.963812928@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