Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faSLI-0003w1-CK for pgsql-general@arkaria.postgresql.org; Tue, 03 Jul 2018 20:56:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faSLG-0003dm-3o for pgsql-general@arkaria.postgresql.org; Tue, 03 Jul 2018 20:56:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faSLF-0003de-SR for pgsql-general@lists.postgresql.org; Tue, 03 Jul 2018 20:56:05 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1faSL8-00067F-Px for pgsql-general@postgresql.org; Tue, 03 Jul 2018 20:56:05 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1faSIz-0002kS-LY for pgsql-general@postgresql.org; Tue, 03 Jul 2018 22:53:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-general@postgresql.org From: Thomas Kellerer Subject: When exactly is a TIMESTAMPTZ converted to the sessions time zone? Date: Tue, 3 Jul 2018 22:55:51 +0200 Lines: 25 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 X-Mozilla-News-Host: news://news.gmane.org:119 Content-Language: en-GB X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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