Re: timestamp with time zone ~> GMT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, bristleconeweb(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: timestamp with time zone ~> GMT
Date: 2025-02-03 17:23:07
Message-ID: 410526.1738603387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> On 2025-Feb-03, Robert Treat wrote:
>> This does seem to come up often enough that it probably is worth being
>> a bit more explicit about how this works; attached patch attempts
>> that.

> LGTM.

Hmm, I kind of like the up-front statement that timestamptz stores
UTC. How about this simpler change?

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 1d9127e94e..269809dc81 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -2263,6 +2263,8 @@ TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'
then it is assumed to be in the time zone indicated by the system's
<xref linkend="guc-timezone"/> parameter, and is converted to UTC using the
offset for the <varname>timezone</varname> zone.
+ In either case, the originally stated or assumed time zone is not
+ retained.
</para>

<para>

>> Note, I dropped the bit about GMT; that change was made ~40 years ago,
>> and I suspect it is close to noise for many people these days, though
>> it could be added back if folks feel strongly about it.

> I don't feel strongly about it, but another option might be to add a
> <footnote> so that it is still there but less intrusive. Grepping for
> GMT in the postgres repo there are still over 1400 matches of all kinds.

I think we'd better not remove the gloss for GMT just yet. It's still
the magic boot value for the timezone GUC for example (cf pgtz.c),
and it's still embedded in the IANA timezone database:

$ ls /usr/share/zoneinfo/Etc
GMT GMT+11 GMT+4 GMT+8 GMT-10 GMT-14 GMT-5 GMT-9 UTC
GMT+0 GMT+12 GMT+5 GMT+9 GMT-11 GMT-2 GMT-6 GMT0 Universal
GMT+1 GMT+2 GMT+6 GMT-0 GMT-12 GMT-3 GMT-7 Greenwich Zulu
GMT+10 GMT+3 GMT+7 GMT-1 GMT-13 GMT-4 GMT-8 UCT

Maybe we could move the info to the Glossary, but that seems like
a separate matter from what's under discussion here.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Dave Cramer 2025-02-03 17:50:05 Re: timestamp with time zone ~> GMT
Previous Message Jonathan Stanley 2025-02-03 16:50:57 Re: timestamp with time zone ~> GMT