Re: Inconsistency of timezones in postgresql

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Chris BSomething <xpusostomos(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Inconsistency of timezones in postgresql
Date: 2024-08-01 05:06:24
Message-ID: CAKFQuwY=_7jByHnmVeX5vKG2wWzf_g_RPRW-yxiBdcxkQG_ZjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wednesday, July 31, 2024, Chris BSomething <xpusostomos(at)gmail(dot)com> wrote:

>
> So... the wiki (not the documentation mind you) says "don't use timestamp"
> because it’s there for compatibility with other databases?
>

The docs focus on what is and try to generally withhold judgement. This
particular area is also quite challenging to address and the motivation to
want to make the effort drops significantly when the tone and quality of
the instigating bug report is so unfavorable.

> and when I use "AT TIME ZONE", it assumes the timestamp is UTC, and makes
> its calculations accordingly.
>

The system rarely assumes things about user data. In this case the session
time zone setting and the various ways to specify time zones exist because
we choose not to assume. The application may store whatever time literal
it wants in a timestamp field and is promised to get that exact same value
out upon retrieval no matter their time zone setting. That’s all it is
documented to do as a data type. Everything else is functions.

Timestamptz is documented to perform rotations according to the time zone
setting upon producing text output. And it tells you what zone it ended up
in.

I do an ALTER COLUMN type timestamptz, and it adds a seemingly random 8
> hours to the values... that's not a bug?
>

As noted on the other reply the bug seems to be in your test setup, not the
system.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Aleksander Alekseev 2024-08-01 10:24:54 Re: Inconsistency of timezones in postgresql
Previous Message David G. Johnston 2024-08-01 04:28:35 Re: Inconsistency of timezones in postgresql