Thread: BUG #5354: Type timestamptz doesn't allow to store time zone

BUG #5354: Type timestamptz doesn't allow to store time zone

From
"Vitali"
Date:
The following bug has been logged online:

Bug reference:      5354
Logged by:          Vitali
Email address:      vitali@lumensoftware.com
PostgreSQL version: 8.1.x 8.2.x
Operating system:   Windows, Linux
Description:        Type timestamptz doesn't allow to store time zone
Details:

I have a table:

CREATE TABLE test (
     set_dt timestamptz,
     set_tm timetz
) WITH OIDS;

I do insert into this table:

INSERT INTO test(set_dt, set_tm)
VALUES('2010-01-01 10:00+02', '10:00+02')

When I select from the table, the timetz has the correct time zone, the
timestamptz has -6 as a time zone, which is my server default.

Re: BUG #5354: Type timestamptz doesn't allow to store time zone

From
Robert Haas
Date:
On Mon, Mar 1, 2010 at 10:52 AM, Vitali <vitali@lumensoftware.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =A0 =A0 =A05354
> Logged by: =A0 =A0 =A0 =A0 =A0Vitali
> Email address: =A0 =A0 =A0vitali@lumensoftware.com
> PostgreSQL version: 8.1.x 8.2.x
> Operating system: =A0 Windows, Linux
> Description: =A0 =A0 =A0 =A0Type timestamptz doesn't allow to store time =
zone
> Details:
>
> I have a table:
>
> CREATE TABLE test (
> =A0 =A0 set_dt timestamptz,
> =A0 =A0 set_tm timetz
> ) WITH OIDS;
>
> I do insert into this table:
>
> INSERT INTO test(set_dt, set_tm)
> VALUES('2010-01-01 10:00+02', '10:00+02')
>
> When I select from the table, the timetz has the correct time zone, the
> timestamptz has -6 as a time zone, which is my server default.

I'm not sure what you think the bug is, but timestamptz definitely
doesn't store the time zone in which the value is input.  What it does
is makes input and output relative to the then-current time zones
rather than fixed wall-clock times.

...Robert