From: przemek@hadapt.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results
Date: Thu, 31 Oct 2013 13:03:49 +0000
Message-ID: <E1Vbruf-0000CQ-QH@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 8572
Logged by: Combination of SET TIME ZONEs and CAST gives wrong results
Email address: przemek@hadapt.com
PostgreSQL version: 9.1.10
Operating system: Ubuntu 12.04.3 LTS
Description:
Reproduction:
postgres=# set time zone 'Europe/Warsaw';
SET
postgres=# set time zone '-1.5';
SET
postgres=# select cast('2012-12-12 12:00 Europe/Warsaw' AS timestamp with
time zone);
timestamptz
---------------------------
2012-12-12 12:00:00-01:30
(1 row)
The same happens for other timezones too, like:
postgres=# set time zone 'Europe/London';
SET
postgres=# set time zone '-1.5';
SET
postgres=# select cast('2012-12-12 12:00 Europe/London' AS timestamp with
time zone);
timestamptz
---------------------------
2012-12-12 12:00:00-01:30
(1 row)
Note, however, that it happens only if the first SET value matches the
timezone given in timestamp string. If they differ, then the result is
correct:
postgres=# set time zone 'Europe/London';
SET
postgres=# set time zone '-1.5';
SET
postgres=# select cast('2012-12-12 12:00 Europe/Warsaw' AS timestamp with
time zone);
timestamptz
---------------------------
2012-12-12 09:30:00-01:30
(1 row)
Bug exsists in 9.2.2 (tested on CentOS 6.3), 9.1.10 (Ubuntu 12.04.3 LTS) and
9.0.6 (CentOS 6.3) versions
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: przemek@hadapt.com
Subject: Re: BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results
In-Reply-To: <E1Vbruf-0000CQ-QH@wrigleys.postgresql.org>
References: <E1Vbruf-0000CQ-QH@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox