ROLLBACK of SET TimeZone - Mailing list pgsql-bugs

From Alexander M. Pravking
Subject ROLLBACK of SET TimeZone
Date
Msg-id 20050214121013.GA71264@dyatel.antar.bryansk.ru
Whole thread Raw
Responses Re: ROLLBACK of SET TimeZone
List pgsql-bugs
If I don't specify time zone either in config or using "SET TimeZone"
first, "SET TimeZone" inside a transaction isn't rolled back. System
time zone is actually Europe/Moscow. Here's an example:

fduch@~=# SELECT current_setting('TimeZone'), now();
 current_setting |              now
-----------------+-------------------------------
 unknown         | 2005-02-14 15:03:41.972955+03
(1 row)

fduch@~=# BEGIN ; SET TimeZone TO 'America/New_York'; SELECT current_setting('TimeZone'), now();
BEGIN
SET
 current_setting  |              now
------------------+-------------------------------
 America/New_York | 2005-02-14 07:03:46.982974-05
(1 row)

fduch@~*=# ROLLBACK ; SELECT current_setting('TimeZone'), now();
ROLLBACK
 current_setting  |             now
------------------+------------------------------
 America/New_York | 2005-02-14 07:03:51.34979-05
(1 row)


However, with explicit initial time zone, it get rolled back okay:

fduch@~=# SET TimeZone TO 'Europe/Moscow'; SELECT current_setting('TimeZone'), now();
SET
 current_setting |              now
-----------------+-------------------------------
 Europe/Moscow   | 2005-02-14 15:03:55.552894+03
(1 row)

fduch@~=# BEGIN ; SET TimeZone TO 'America/New_York'; SELECT current_setting('TimeZone'), now();
BEGIN
SET
 current_setting  |              now
------------------+-------------------------------
 America/New_York | 2005-02-14 07:03:59.891249-05
(1 row)

fduch@~*=# ROLLBACK ; SELECT current_setting('TimeZone'), now();
ROLLBACK
 current_setting |             now
-----------------+------------------------------
 Europe/Moscow   | 2005-02-14 15:04:06.67614+03
(1 row)

fduch@~=# SELECT version();
                                            version
------------------------------------------------------------------------------------------------
 PostgreSQL 7.4.6 on i386-portbld-freebsd5.3, compiled by GCC cc (GCC) 3.4.2 [FreeBSD] 20040728
(1 row)

Comments?


--
Fduch M. Pravking

pgsql-bugs by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1478: Upper function does not work
Next
From: "Glen"
Date:
Subject: BUG #1480: A wildcard for the listen address doesn't work