From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@postgresql.org
Subject: When exactly is a TIMESTAMPTZ converted to the sessions time zone?
Date: Tue, 3 Jul 2018 22:55:51 +0200
Message-ID: <phgnok$vc9$1@blaine.gmane.org> (raw)
A recent discussion around timestamptz behaviour has lead me to question my own understanding on how a TIMESTAMPTZ is converted to the session's time zone.
I assumed this conversion happens *on the server* before the value is sent to the client.
A co-worker of mine claims that this is purely a client side thing, and that the server will always send the "plain" UTC value that is stored in a timestamptz column.
The manual is ambiguous - at least to me
When a timestamp with time zone value is output, is always converted from UTC
to the current timezone zone, and displayed as local time in that zone
Does "is output" refer to the output on the client (after receiving a UTC value) or the sending of a converted value?
In this email: https://www.postgresql.org/message-id/19896.1152889217%40sss.pgh.pa.us
Tom Lane states:
They are converted to local time in the zone specified by the timezone
configuration parameter before being displayed to the client
but the "before being displayed" could also refer to a conversion on the server.
Could someone enlighten me, please?
Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: When exactly is a TIMESTAMPTZ converted to the sessions time zone?
In-Reply-To: <phgnok$vc9$1@blaine.gmane.org>
References: <phgnok$vc9$1@blaine.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox