BUG #4963: Selecting timestamp without timezone at timezone gives wrong output

From: "William Crawford" <william(at)ezyield(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4963: Selecting timestamp without timezone at timezone gives wrong output
Date: 2009-08-04 13:11:51
Message-ID: 200908041311.n74DBplw068589@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4963
Logged by: William Crawford
Email address: william(at)ezyield(dot)com
PostgreSQL version: 8.3.7
Operating system: Gentoo
Description: Selecting timestamp without timezone at timezone gives
wrong output
Details:

set time zone 'US/Eastern';
select timestamp '2009-01-01', timestamp '2009-01-01' at time zone
'US/Pacific' as withouttimezone, timestamp with time zone '2009-01-01' at
time zone 'US/Pacific' as withtimezone;

timestamp | withouttimezone | withtimezone
---------------------+------------------------+---------------------
2009-01-01 00:00:00 | 2009-01-01 03:00:00-05 | 2008-12-31 21:00:00
(1 row)

I expect the last 2 values to be the same. (WithTimeZone is correct.)
Instead, it goes the correct number of hours in the wrong direction for
WithoutTimeZone. This happens for all time zones that I've tested.

Also happens when pulling data from a table, and not just on this select
statement, and with or without times.

select version();
version
----------------------------------------------------------------------------
-----------------------------------------------
PostgreSQL 8.3.7 on x86_64-pc-linux-gnu, compiled by GCC
x86_64-pc-linux-gnu-gcc (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2

(Also happens on 8.2.6.)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message wader2 2009-08-04 13:26:35 Re: BUG #4961: pg_standby.exe crashes with no args
Previous Message Carlos Alonso 2009-08-04 10:49:52 BUG #4962: Pre-existing shared memory block is still in use