dbTalk Databases Forums  

[BUGS] BUG #2482: Wrong result in timestamp_in, timestamptz_in, date_in

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


Discuss [BUGS] BUG #2482: Wrong result in timestamp_in, timestamptz_in, date_in in the mailing.database.pgsql-bugs forum.



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

Default [BUGS] BUG #2482: Wrong result in timestamp_in, timestamptz_in, date_in - 06-15-2006 , 10:13 PM







The following bug has been logged online:

Bug reference: 2482
Logged by: Alexander Galler
Email address: galler (AT) kuzbass (DOT) net
PostgreSQL version: 8.1.3
Operating system: Windows XP
Description: Wrong result in timestamp_in, timestamptz_in, date_in
Details:

SET SESSION DateStyle TO ISO, YMD;
select '20.01.01 BC'::timestamp;
Result:
"2020-01-01 00:00:00 BC"
I want "20-01-01 00:00:00 BC"

select '20.01.01 BC'::timestamptz
Result:
"2020-01-01 00:00:00+06:11 BC"
I want "20-01-01 00:00:00+06:11 BC"

select '20.01.01 BC'::date
Result:
"2020-01-01 BC"
I want "20-01-01 BC"

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2482: Wrong result in timestamp_in, timestamptz_in, date_in - 06-15-2006 , 11:07 PM






"Alexander Galler" <galler (AT) kuzbass (DOT) net> writes:
Quote:
select '20.01.01 BC'::timestamp;
Result:
"2020-01-01 00:00:00 BC"
I want "20-01-01 00:00:00 BC"
You can write
select '0020.01.01 BC'::timestamp;

I agree it seems like a bug that the 'yy'->'20yy' conversion is applied
to BC dates. The code appears to try to avoid that, but I think it's
confused in this case because 'BC' hasn't been scanned yet.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


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.