Re: Unexpected date conversion results

2025-11-24 Thread Steve Crawford
On Fri, Nov 21, 2025 at 4:55 PM Tom Lane wrote: > Laurenz Albe writes: > > I dug into the git history, and it has been like that since commit > b3506006b564 > > in 2002 (way before version 9.x). That commit fixed a bug that returned > ten > > time the correct reault (but still offset from the U

Re: Unexpected date conversion results

2025-11-21 Thread Tom Lane
Laurenz Albe writes: > I dug into the git history, and it has been like that since commit > b3506006b564 > in 2002 (way before version 9.x). That commit fixed a bug that returned ten > time the correct reault (but still offset from the UTC epoch). I didn't bisect, but I get this in 9.1.24: reg

Re: Unexpected date conversion results

2025-11-21 Thread Adrian Klaver
On 11/21/25 16:38, Adrian Klaver wrote: On 11/21/25 16:09, Steve Crawford wrote: Either there is a bug in my understanding or one in PostgreSQL. I expect a date value to follow the current time zone setting and be interpreted as midnight at the start of the given date. In many cases it does. S

Re: Unexpected date conversion results

2025-11-21 Thread Tom Lane
Steve Crawford writes: > However, extracting the epoch from current_date returns 4pm the prior day > (i.e. 2025-11-21 00:00:00-00), in other words midnight 2025-11-21 UTC which > seems to be inconsistent behavior: > steve=> select to_timestamp(extract(epoch from current_date)); > to_timesta

Re: Unexpected date conversion results

2025-11-21 Thread Laurenz Albe
On Fri, 2025-11-21 at 16:38 -0800, Adrian Klaver wrote: > > There was a time, like version 9-dot-something, when the above queries > > performed as expected returning midnight in the current time zone but I > > haven't been able to find a change document indicating this as an > > expected change

Re: Unexpected date conversion results

2025-11-21 Thread Adrian Klaver
On 11/21/25 16:09, Steve Crawford wrote: Either there is a bug in my understanding or one in PostgreSQL. I expect a date value to follow the current time zone setting and be interpreted as midnight at the start of the given date. In many cases it does. Shown below are the postgresql.conf settin

Unexpected date conversion results

2025-11-21 Thread Steve Crawford
Either there is a bug in my understanding or one in PostgreSQL. I expect a date value to follow the current time zone setting and be interpreted as midnight at the start of the given date. In many cases it does. Shown below are the postgresql.conf settings and the psql client settings showing the t