dbTalk Databases Forums  

FW: [BUGS] postgresql 7.3.2 bug on date '1901-12-13' and '190 1-1

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss FW: [BUGS] postgresql 7.3.2 bug on date '1901-12-13' and '190 1-1 in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stephan Szabo
 
Posts: n/a

Default FW: [BUGS] postgresql 7.3.2 bug on date '1901-12-13' and '190 1-1 - 08-20-2003 , 10:01 PM







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 (AT) megazone (DOT) bigpanda.com]
Sent: Thursday, 21 August 2003 3:53 AM
To: Arnold Mavromatis
Cc: Lan Tran; 'meg (AT) bom (DOT) gov.au'; 'aam (AT) bom (DOT) 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.



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.