Re: BUG #2768: dates before year 1600 in timestamptz column give strange results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mikko Tiihonen <mikko(dot)tiihonen(at)iki(dot)fi>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2768: dates before year 1600 in timestamptz column give strange results
Date: 2006-11-21 06:46:09
Message-ID: 26368.1164091569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Mikko Tiihonen <mikko(dot)tiihonen(at)iki(dot)fi> writes:
> On Mon, 20 Nov 2006, Tom Lane wrote:
>> ... The weird offset from GMT is probably a function of your local
>> timezone, which you didn't mention.

> My database in configured to timezone Europe/Helsinki aka +0200.

The zic database says that Helsinki kept local mean solar time before
1921:

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Helsinki 1:39:52 - LMT 1878 May 31
1:39:52 - HMT 1921 May # Helsinki Mean Time
2:00 Finland EE%sT 1981 Mar 29 2:00
2:00 EU EE%sT

Of course, back in the 1600's they probably didn't keep time as
accurately as all that, but feel free to change your copy of that
configuration file if you want a different answer. I'd be willing
to bet that around 1900, the 1:39 offset was indeed correct.

FWIW, pre-8.2 Postgres does have some issues with displaying
fractional-minute GMT offsets. PG 8.1.5:

regression=# set timezone = 'Europe/Helsinki';
SET
regression=# select '1600-01-01'::timestamptz;
timestamptz
---------------------------
1600-01-01 00:00:00+01:39
(1 row)

CVS HEAD gets it right:

regression=# set timezone = 'Europe/Helsinki';
SET
regression=# select '1600-01-01'::timestamptz;
timestamptz
------------------------------
1600-01-01 00:00:00+01:39:52
(1 row)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bill 2006-11-21 09:15:03 210 - SQL STATE = 28000
Previous Message Mikko Tiihonen 2006-11-21 06:33:18 Re: BUG #2768: dates before year 1600 in timestamptz column