Re: Converting a timestamp to a date when it contains nulls. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Converting a timestamp to a date when it contains nulls.
Date
Msg-id 15083.964408911@sss.pgh.pa.us
Whole thread Raw
In response to Re: Converting a timestamp to a date when it contains nulls.  ("Michael Richards" <michael@fastmail.ca>)
List pgsql-bugs
"Michael Richards" <michael@fastmail.ca> writes:
>>> Shouldn't all casts be able to handle the case where it is NULL?
>>
>> Yup, it's a bug.  It's fixed in current sources.

> Is there a patch available that I can apply to the 7.0.2 source to
> fix the problem? Or is there going to be a 7.0.3 that I should wait
> for?

Just look for the place where the error is being spit out (somewhere in
backend/utils/adt/) and change the "elog(ERROR, ...)" call into
"return NULL".  Should work, but I haven't tried it in 7.0.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Michael Richards"
Date:
Subject: Re: Converting a timestamp to a date when it contains nulls.
Next
From: "Michael Richards"
Date:
Subject: Index selection on a large table