Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 27bdb0c

Browse files
committed
Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin.
1 parent 82468b4 commit 27bdb0c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/backend/commands/variable.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.106 2005/04/19 03:13:58 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.107 2005/06/05 01:48:34 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -284,7 +284,11 @@ assign_timezone(const char *value, bool doit, GucSource source)
284284
if (doit)
285285
{
286286
/* Here we change from SQL to Unix sign convention */
287+
#ifdef HAVE_INT64_TIMESTAMP
288+
CTimeZone = -(interval->time / USECS_PER_SEC);
289+
#else
287290
CTimeZone = -interval->time;
291+
#endif
288292

289293
HasCTZSet = true;
290294
}
@@ -398,8 +402,12 @@ show_timezone(void)
398402
{
399403
Interval interval;
400404

401-
interval. month = 0;
402-
interval. time = -CTimeZone;
405+
interval.month = 0;
406+
#ifdef HAVE_INT64_TIMESTAMP
407+
interval.time = -(CTimeZone * USECS_PER_SEC);
408+
#else
409+
interval.time = -CTimeZone;
410+
#endif
403411

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

0 commit comments

Comments
 (0)