pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results
2+ messages / 2 participants
[nested] [flat]

* BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results
@ 2013-10-31 13:03 przemek@hadapt.com
  2013-11-01 18:12 ` Re: BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: przemek@hadapt.com @ 2013-10-31 13:03 UTC (permalink / raw)
  To: pgsql-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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results
  2013-10-31 13:03 BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results przemek@hadapt.com
@ 2013-11-01 18:12 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2013-11-01 18:12 UTC (permalink / raw)
  To: przemek@hadapt.com; +Cc: pgsql-bugs

przemek@hadapt.com writes:
> 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

I've committed fixes for this and some related problems.  Thanks for the
report!

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-11-01 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-10-31 13:03 BUG #8572: Combination of SET TIME ZONEs and CAST gives wrong results przemek@hadapt.com
2013-11-01 18:12 ` Tom Lane <tgl@sss.pgh.pa.us>

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