Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit27bdb0c

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 parent82468b4 commit27bdb0c

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+
#ifdefHAVE_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
Intervalinterval;
400404

401-
interval.month=0;
402-
interval.time=-CTimeZone;
405+
interval.month=0;
406+
#ifdefHAVE_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)

[8]ページ先頭

©2009-2025 Movatter.jp