From: Kasper Rönning <kasper.ronning@reliabit.fi>
To: pgsql-bugs@postgresql.org
Subject: Issue when displaying TIMESTAMPTZ values
Date: Thu, 07 Jun 2012 16:51:00 +0300
Message-ID: <4FD0B1C4.7040307@reliabit.fi> (raw)
Hi,
I seem to have found a bug in Postgres 9.1.3. Apparently timestamp
values are stored correctly in the database, but querying it returns
invalid results. My environment is Windows 7 64bit. The unexpected
result is that timestamps before 1st of May 1921 are displayed
incorrectly when time zone is 'Europe/Helsinki'.
----------------- [snip] ----------------------
SELECT version();
DROP TABLE IF EXISTS test2;
CREATE TABLE test2 (ts TIMESTAMPTZ NOT NULL DEFAULT NOW());
INSERT INTO test2 VALUES ('1921-01-01 00:00:00+00');
INSERT INTO test2 VALUES ('1921-04-29 00:00:00+00');
INSERT INTO test2 VALUES ('1921-04-30 00:00:00+00');
INSERT INTO test2 VALUES ('1921-05-01 00:00:00+00');
INSERT INTO test2 VALUES ('1922-01-01 00:00:00+00');
INSERT INTO test2 VALUES ('1999-01-08 04:05:06 -8:00');
INSERT INTO test2 VALUES ('today allballs');
SET TIME ZONE EET;
SELECT * FROM test2;
-- ts
-- ------------------------
-- 1921-01-01 02:00:00+02
-- 1921-04-29 02:00:00+02
-- 1921-04-30 02:00:00+02
-- 1921-05-01 02:00:00+02
-- 1922-01-01 02:00:00+02
-- 1999-01-08 14:05:06+02
-- 2012-06-07 03:00:00+03
-- (7 rows)
SET TIME ZONE 'Europe/Helsinki';
SELECT * FROM test2;
-- ts
-- ------------------------------
-- 1921-01-01 01:39:52+01:39:52
-- 1921-04-29 01:39:52+01:39:52
-- 1921-04-30 01:39:52+01:39:52
-- 1921-05-01 02:00:00+02
-- 1922-01-01 02:00:00+02
-- 1999-01-08 14:05:06+02
-- 2012-06-07 03:00:00+03
-- (7 rows)
----------------- [snip] ----------------------
Best regards
Kasper Rönning
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: kasper.ronning@reliabit.fi
Subject: Re: Issue when displaying TIMESTAMPTZ values
In-Reply-To: <4FD0B1C4.7040307@reliabit.fi>
References: <4FD0B1C4.7040307@reliabit.fi>
* 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