Re: "localtime" value in TimeZone - Mailing list pgsql-hackers

From Tom Lane
Subject Re: "localtime" value in TimeZone
Date
Msg-id 27164.1563983412@sss.pgh.pa.us
Whole thread Raw
In response to "localtime" value in TimeZone  (Shay Rojansky <roji@roji.org>)
Responses Re: "localtime" value in TimeZone  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
Shay Rojansky <roji@roji.org> writes:
> In (certain) out-of-the-box PostgreSQL installations, the timezone GUC is
> set to "localtime", which seems to mean to query the OS for the value.
> Unless I'm mistaken, the issue with this is that it doesn't allow clients
> inspecting the TimeZone GUC to actually know what timezone the server is
> in, making the GUC largely useless (and creates friction as the GUC can't
> be expected to always contain valid IANA/Olson values). It would be more
> useful if PostgreSQL exposed the actual timezone provided by the OS.

> Does this make sense?

Yeah, this is something that some tzdb packagers do --- they put a
"localtime" file into /usr/share/zoneinfo that is a symlink or hard link
to the active zone file, and then initdb tends to seize on that as being
the shortest available spelling of the active zone.

I opined in
https://www.postgresql.org/message-id/27991.1560984458@sss.pgh.pa.us
that we should avoid choosing "localtime", but that thread seems
stalled on larger disagreements about how complicated we want that
mechanism to be.

> As a side note, there doesn't seem to be any specific documentation on the
> special "localtime" value of this GUC

That's because it's nonstandard and platform-specific.  It's also
not special from our standpoint --- it's jsut another zone file.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] minor bugfix for pg_basebackup (9.6 ~ )
Next
From: Heikki Linnakangas
Date:
Subject: Re: GiST VACUUM