Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour
Date
Msg-id 3379884.1642173892@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-bugs
Francisco Olarte <folarte@peoplecall.com> writes:
> On Fri, 14 Jan 2022 at 11:15, PG Bug reporting form
> <noreply@postgresql.org> wrote:
>> postgres=# set timezone to "PST8PDT";
>> ..
>> postgres=# select (timestamp '2021-03-14 02:00:00')::timestamptz;
>> 2021-03-14 03:00:00-07
>> postgres=# select (timestamp '2021-03-14 03:00:00')::timestamptz;
>> 2021-03-14 03:00:00-07

> You are playing around the DST changes, and timestamp must have unique
> representations, for informal descriptions "time jumps from 2 to 3" is
> fine, when dealing with real data you must decide if it jumps just
> before or just after, it seems your expectations are wrong:

Yeah.  See

https://www.postgresql.org/docs/devel/datetime-invalid-input.html

(I'm pointing you to the devel version of that page because it
contains a correction that hasn't yet propagated into the other
versions)

            regards, tom lane



pgsql-bugs by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour
Next
From: Alexander Lakhin
Date:
Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum