Thread: FW: postgresql 7.3.2 bug on date '1901-12-13' and '190 1-1 2 (fwd)

FW: postgresql 7.3.2 bug on date '1901-12-13' and '190 1-1 2 (fwd)

From
Stephan Szabo
Date:
I'm forwarding part of the response to a query for information I'd
sent related to this.  The interesting thing here I think
is the to_timestamp returns for 1901/12/13 and 1901/12/14.

------
db1=> select cast(timestamptz '1901/12/13' as date);
    date
------------
 1901-12-13
(1 row)

db1=> select cast(timestamptz '1901/12/14' as date);
    date
------------
 1901-12-13
(1 row)

db1=> select to_timestamp('1901/12/13', 'YYYY/MM/DD');
    to_timestamp
---------------------
 1901-12-13 00:00:00
(1 row)

db1=> select to_timestamp('1901/12/14', 'YYYY/MM/DD');
    to_timestamp
---------------------
 1901-12-13 13:00:00
(1 row)

db1=> select to_date('1901/12/13', 'YYYY/MM/DD');
  to_date
------------
 1901-12-13
(1 row)

db1=> select to_date('1901/12/14', 'YYYY/MM/DD');
  to_date
------------
 1901-12-13
(1 row)

db1=>


db1=> select timestamptz '1901/12/14';
     timestamptz
---------------------
 1901-12-13 13:00:00
(1 row)

db1=> select timestamptz '1901/12/13';
     timestamptz
---------------------
 1901-12-13 00:00:00
(1 row)

================================================================

-----Original Message-----
From: Stephan Szabo [mailto:sszabo@megazone.bigpanda.com]
Sent: Thursday, 21 August 2003 3:53 AM
To: Arnold Mavromatis
Cc: Lan Tran; 'meg@bom.gov.au'; 'aam@bom.gov.au'
Subject: Re: FW: FW: [BUGS] postgresql 7.3.2 bug on date '1901-12-13' and
'190 1-12



Noone seems to have jumped on this yet, so I figured I'd do a little more
looking. Unfortunately in the end, you may need to do some grotting around
with a debugger. :(

What do
 select timestamptz '1901/12/13';
 select timestamptz '1901/12/14';
 select cast(timestamptz '1901/12/13' as date);
 select cast(timestamptz '1901/12/14' as date);
 select to_timestamp('1901/12/13', 'YYYY/MM/DD');
 select to_timestamp('1901/12/14', 'YYYY/MM/DD');
 select to_date('1901/12/13', 'YYYY/MM/DD');
 select to_date('1901/12/14', 'YYYY/MM/DD');
give you?

I'd also suggest considering building a 7.3.4 system and seeing if you get
the same odd results from there.