Re: BUG #1699: Invalid timestamps with timezone and interger timestamps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Guillaume Beaudoin" <guillaume(dot)beaudoin(at)bdeb(dot)qc(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1699: Invalid timestamps with timezone and interger timestamps
Date: 2005-06-05 01:52:26
Message-ID: 29757.1117936346@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Guillaume Beaudoin" <guillaume(dot)beaudoin(at)bdeb(dot)qc(dot)ca> writes:
> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Dan 2005-06-05 06:54:11 BUG #1701: Installer problem w/ encryption
Previous Message Michael Fuhr 2005-06-03 16:05:52 Re: BUG #1700: Error on Subselect with date in where condition