Re: Converting to UTC multiple times converts back to local time zone - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Converting to UTC multiple times converts back to local time zone
Date
Msg-id CAKFQuwaEA0XLWTpBG7aqZ_qz3FDT_E54zjXfhfRfoxzskd_B5A@mail.gmail.com
Whole thread Raw
In response to Re: Converting to UTC multiple times converts back to local time zone  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
On Mon, Jun 25, 2018 at 5:52 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
 timestamptz AT TIME ZONE's usefulness is marginal at best - and in any case should not be used in subqueries.  Pass the original timestamptz typed value around until you are ready to send it to the user.

​Just to clarify that a bit - usually query results as passed to another layer which then presents the results to a person.  Pass that layer a timestamptz and let it decide how to deal with presentation.  If psql is used as the client presentation layer then you will need to use AT TIME ZONE (or TimeZone GUC depending on the situation) but that still falls within the general idea of pushing display as close to the user as possible.

David J.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Converting to UTC multiple times converts back to local time zone
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15252: "do not dump comments" in pg_restore help