Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: dafoer_x(at)163(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour
Date: 2022-01-14 15:24:52
Message-ID: 3379884.1642173892@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Francisco Olarte <folarte(at)peoplecall(dot)com> writes:
> On Fri, 14 Jan 2022 at 11:15, PG Bug reporting form
> <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2022-01-14 17:00:00 Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum
Previous Message Francisco Olarte 2022-01-14 11:30:54 Re: BUG #17366: Error result returned in timestamp2timestamptz, expected to be off by one hour