Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB811eP18894; Thu, 7 Dec 2000 20:01:40 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eB811pY28883; Thu, 7 Dec 2000 20:01:51 -0500 (EST) To: "Edmar Wiggers" cc: pgsql-sql@postgresql.org, pgsql-bugs@postgresql.org Subject: Re: [SQL] Unable to convert null timestamp to date. Bug? In-reply-to: References: Comments: In-reply-to "Edmar Wiggers" message dated "Thu, 07 Dec 2000 21:08:09 -0200" Date: Thu, 07 Dec 2000 20:01:51 -0500 Message-ID: <28880.976237311@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200012/47 X-Sequence-Number: 236 "Edmar Wiggers" 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