pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Edmar Wiggers <edmar@brasmap.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: [SQL] Unable to convert null timestamp to date. Bug?
Date: Thu, 07 Dec 2000 20:01:51 -0500
Message-ID: <28880.976237311@sss.pgh.pa.us> (raw)
In-Reply-To: <NEBBIAKDCDHFGJMLHCKIMEPKCBAA.edmar@brasmap.com>
References: <NEBBIAKDCDHFGJMLHCKIMEPKCBAA.edmar@brasmap.com>

"Edmar Wiggers" <edmar@brasmap.com> writes:
>   select * from users where last_visit + 7 > now();
>   ERROR:  Unable to convert null timestamp to date

Yeah, someone who hadn't quite grokked the concept of NULL seems to have
written a lot of the date.c code :-(.

This is fixed for 7.1.  If it's really bothering you in 7.0.*, see
src/backend/utils/adt/date.c, and change code like

    if (!PointerIsValid(timestamp))
        elog(ERROR, "Unable to convert null timestamp to date");

to

    if (!PointerIsValid(timestamp))
	return NULL;

in several places.

			regards, tom lane



view thread (2+ messages)

Message-ID: <28880.976237311@sss.pgh.pa.us>
Permalink:  ../28880.976237311@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28880.976237311@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, edmar@brasmap.com, pgsql-bugs@postgresql.org
  Subject: Re: [SQL] Unable to convert null timestamp to date. Bug?
  In-Reply-To: <28880.976237311@sss.pgh.pa.us>
  References: <NEBBIAKDCDHFGJMLHCKIMEPKCBAA.edmar@brasmap.com> <28880.976237311@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