pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-general@postgresql.org
Subject: Re: When exactly is a TIMESTAMPTZ converted to the sessions time zone?
Date: Tue, 03 Jul 2018 17:00:17 -0400
Message-ID: <65821.1530651617@sss.pgh.pa.us> (raw)
In-Reply-To: <phgnok$vc9$1@blaine.gmane.org>
References: <phgnok$vc9$1@blaine.gmane.org>

Thomas Kellerer <spam_eater@gmx.net> writes:
> 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.

It's done in the datatype's output conversion function.

> 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.

Your co-worker is certainly wrong so far as text output is concerned.
If you retrieve data in binary format, though, it looks like you get
the raw (un-rotated) timestamp value, so that any conversion would have
to be done on the client side.

			regards, tom lane




view thread (4+ messages)  latest in thread

Message-ID: <65821.1530651617@sss.pgh.pa.us>
Permalink:  ../65821.1530651617@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/65821.1530651617@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, spam_eater@gmx.net
  Subject: Re: When exactly is a TIMESTAMPTZ converted to the sessions time zone?
  In-Reply-To: <65821.1530651617@sss.pgh.pa.us>
  References: <phgnok$vc9$1@blaine.gmane.org> <65821.1530651617@sss.pgh.pa.us>

* 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