Re: datestyle=postgres broken with timezone=UTC+N - Mailing list pgsql-hackers

From Tom Lane
Subject Re: datestyle=postgres broken with timezone=UTC+N
Date
Msg-id 20976.1440946967@sss.pgh.pa.us
Whole thread Raw
In response to datestyle=postgres broken with timezone=UTC+N  (Christoph Berg <cb@df7cb.de>)
Responses Re: datestyle=postgres broken with timezone=UTC+N  (Christoph Berg <cb@df7cb.de>)
List pgsql-hackers
Christoph Berg <cb@df7cb.de> writes:
> postgres =# set timezone = 'Etc/UTC+1';
> SET
> postgres =# set datestyle = 'postgres';
> SET
> postgres =# select '2015-01-01 01:00:00 +0100'::timestamptz;
>  Wed 31 Dec 23:00:00 2014 ETC/UTC

> postgres =# select 'Wed 31 Dec 23:00:00 2014 ETC/UTC'::timestamptz;
>  Wed 31 Dec 22:00:00 2014 ETC/UTC

Not sure I see your point?  Lacking any entry for ETC/UTC in the
timezone_abbreviations file, we'll look it up in the zoneinfo database,
and that will tell us it means UTC+0.  So the input means 2300 UTC, and
that gets displayed as 2200 in your UTC-1 display timezone.

No, this isn't entirely consistent with the way the timezone name is being
used in output.  But that's because you've only half-configured the system
for a weird timezone name.  You would need an abbreviation entry as well
if you want "ETC/UTC" to be read as UTC-1.

For more info read
http://www.postgresql.org/docs/9.4/static/datatype-datetime.html#DATATYPE-TIMEZONES
--- see particularly the FOOBAR0 example, which is exactly what you've
got here.  By and large, I don't recommend use of POSIX notation in
timezone settings; the IANA geographical zone names are much less likely
to bite you on the rear.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Horizontal scalability/sharding
Next
From: Kevin Grittner
Date:
Subject: SimpleTee flush