From: Tom Lane Date: Sun, 5 Jun 2005 01:48:55 +0000 (+0000) Subject: Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=83de50f7e143d1c03e315675bb06011bee211366;p=users%2Fbernd%2Fpostgres.git Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin. --- diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 62f04dc158..d4b62c5be7 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -454,7 +454,11 @@ assign_timezone(const char *value, bool doit, bool interactive) 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,7 +612,11 @@ show_timezone(void) 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)));