dbTalk Databases Forums  

[BUGS] BUG #1699: Invalid timestamps with timezone and interger timestamps

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


Discuss [BUGS] BUG #1699: Invalid timestamps with timezone and interger timestamps in the mailing.database.pgsql-bugs forum.



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

Default [BUGS] BUG #1699: Invalid timestamps with timezone and interger timestamps - 06-03-2005 , 08:22 AM







The following bug has been logged online:

Bug reference: 1699
Logged by: Guillaume Beaudoin
Email address: guillaume.beaudoin (AT) bdeb (DOT) qc.ca
PostgreSQL version: 7.4.8
Operating system: Debian GNU/Linux
Description: Invalid timestamps with timezone and interger timestamps
Details:

SET TIME ZONE INTERVAL '-05:00' HOUR TO MINUTE;
SELECT NOW();

will report something like:

now
--------------------------------------
1979-06-06 09:42:49.854158-227814:06
(1 row)


Please check http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=311533 for
more informations about this.

Regards,

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1699: Invalid timestamps with timezone and interger timestamps - 06-04-2005 , 08:54 PM






"Guillaume Beaudoin" <guillaume.beaudoin (AT) bdeb (DOT) qc.ca> writes:
Quote:
Description: Invalid timestamps with timezone and interger timestamps
Fixed for next releases --- thanks for the report!
The 7.4-branch patch is

Index: variable.c
================================================== =================
RCS file: /cvsroot/pgsql/src/backend/commands/variable.c,v
retrieving revision 1.88.2.1
diff -c -r1.88.2.1 variable.c
*** variable.c 11 Aug 2004 21:10:50 -0000 1.88.2.1
--- variable.c 5 Jun 2005 01:39:03 -0000
***************
*** 454,460 ****
--- 454,464 ----
if (doit)
{
/* Here we change from SQL to Unix sign convention */
+ #ifdef HAVE_INT64_TIMESTAMP
+ CTimeZone = -(interval->time / INT64CONST(1000000));
+ #else
CTimeZone = -interval->time;
+ #endif
HasCTZSet = true;
}
pfree(interval);
***************
*** 608,614 ****
--- 612,622 ----
Interval interval;

interval.month = 0;
+ #ifdef HAVE_INT64_TIMESTAMP
+ interval.time = -(CTimeZone * INT64CONST(1000000));
+ #else
interval.time = -CTimeZone;
+ #endif

tzn = DatumGetCString(DirectFunctionCall1(interval_out,
IntervalPGetDatum(&interval)));


regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


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.