Re: mark the timestamptz variant of date_bin() as stable - Mailing list pgsql-hackers

From Tom Lane
Subject Re: mark the timestamptz variant of date_bin() as stable
Date
Msg-id 2116754.1630523742@sss.pgh.pa.us
Whole thread Raw
In response to mark the timestamptz variant of date_bin() as stable  (John Naylor <john.naylor@enterprisedb.com>)
List pgsql-hackers
Justin Pryzby <pryzby@telsasoft.com> writes:
> On Wed, Sep 01, 2021 at 01:26:26PM -0400, John Naylor wrote:
>> I'm not quite willing to bet the answer couldn't change if the timezone
>> changes, but it's possible I'm the one missing something.

> ts=# SET timezone='-12';
> ts=# SELECT date_bin('1hour', '2021-07-01 -1200', '2021-01-01');
> date_bin | 2021-07-01 00:00:00-12

> ts=# SET timezone='+12';
> ts=# SELECT date_bin('1hour', '2021-07-01 -1200', '2021-01-01');
> date_bin | 2021-07-02 00:00:00+12

Yeah, but those are the same timestamptz value.

Another problem with this example as written is that the origin
values being used are not the same in the two cases ... so I
think it's a bit accidental that the answers come out the same.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: mark the timestamptz variant of date_bin() as stable
Next
From: John Naylor
Date:
Subject: Re: mark the timestamptz variant of date_bin() as stable