Re: Problem with null dates in 7.2

Started by David Griffithsabout 24 years ago3 messagesgeneral
Jump to latest
#1David Griffiths
dgriffiths@boats.com

Shouldn't you be using,

SELECT * FROM foo WHERE bar_date IS NULL?

"= null" got phased out, I believe.

David

"Jon" <xilj_74@hotmail.com> wrote in message
news:lMFa8.138677$a07.38860107@typhoon.southeast.rr.com...

I've just compiled 7.2 under HPUX 10.20 and upgraded my data from 7.1.3
(followed the upgrade guide verbatim). I now have a big problem trying to
select date types with null values. The following example gives 0

results,

although some do exist -

select * from foo where bar_date=null;

Under 7.1.3 the above query returns results .. I can insert a date and

then

update it to null, but the query just doesn't work! Everything else seems
to be working as expected.

I haven't seen this mentioned as a bug, did I miss something in the

release

Show quoted text

notes perhaps? Any insight would be greatly appreciated!

Thanks,

Jon

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Griffiths (#1)

"David Griffiths" <dgriffiths@boats.com> writes:

Shouldn't you be using,
SELECT * FROM foo WHERE bar_date IS NULL?

Yup.

"= null" got phased out, I believe.

Or at least disabled by default. See
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/functions-comparison.html

regards, tom lane

#3Hans-Jürgen Schönig
postgres@cybertec.at
In reply to: David Griffiths (#1)

David Griffiths wrote:

Shouldn't you be using,

SELECT * FROM foo WHERE bar_date IS NULL?

"= null" got phased out, I believe.

David

There is a parameterin postgresql.conf where you can turn the old behaviour on.

hans