BUG #2768: dates before year 1600 in timestamptz column give strange results - Mailing list pgsql-bugs

From Mikko Tiihonen
Subject BUG #2768: dates before year 1600 in timestamptz column give strange results
Date
Msg-id 200611190200.kAJ20wBh086953@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2768: dates before year 1600 in timestamptz column give strange results
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2768
Logged by:          Mikko Tiihonen
Email address:      mikko.tiihonen@iki.fi
PostgreSQL version: 8.1.5
Operating system:   Linux/amd64/gcc-4.1.1
Description:        dates before year 1600 in timestamptz column give
strange results
Details:

createuser -s -d test
createdb -E LATIN9 -O test test
psql -U test
---
CREATE TEMP TABLE tester (stamp timestamp(6) with time zone);
INSERT INTO tester (stamp) VALUES ( '0134-05-06 09:12:34.123456 +0200' );
INSERT INTO tester (stamp) VALUES ( '2134-05-06 09:12:34.123456 +0200' );
SELECT * FROM tester;
---
PostgreSQL compiled with intdatetime=on
              stamp
----------------------------------
 0134-05-06 08:52:26.123456+01:39
 2134-05-06 09:12:34.123456+02
(2 rows)

PostgreSQL compiled with intdatetime=off
              stamp
----------------------------------
 0134-05-06 08:52:26.123459+01:39
 2134-05-06 09:12:34.123456+02
(2 rows)


If I fetch the rows using v3 protocol with and binary encoding for the
timestamp field I get back has the correct time. If I fetch the rows using
text encoding I get the same erronous value as with psql.

That makes me think the problem is in converting the internal timestamptz
format to formatted text.

pgsql-bugs by date:

Previous
From: Kenneth Marshall
Date:
Subject: Re: [PERFORM] BUG #2737: hash indexing large tablefails,while btree of same index works
Next
From: Reece Hart
Date:
Subject: Re: BUG #2764: Capital letter in tables or columns not