Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKMfZ-0004kp-3f for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Mar 2021 14:52:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKMfX-00049e-Vz for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Mar 2021 14:52:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKMfX-00047x-Pk for pgsql-bugs@lists.postgresql.org; Thu, 11 Mar 2021 14:52:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKMfV-00019p-GX for pgsql-bugs@lists.postgresql.org; Thu, 11 Mar 2021 14:52:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12BEq2vQ2290616; Thu, 11 Mar 2021 09:52:02 -0500 From: Tom Lane To: mjfshark@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16923: Timestamptz always returns utc time when resultformat is in binary format. In-reply-to: <16923-02bede34869fc819@postgresql.org> References: <16923-02bede34869fc819@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 11 Mar 2021 12:54:11 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2290614.1615474322.1@sss.pgh.pa.us> Date: Thu, 11 Mar 2021 09:52:02 -0500 Message-ID: <2290615.1615474322@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Using libpq.dll and requesting a result set in binary format. Timestamptz > results are returned in UTC timezone instead of the current session's > timezone setting. Note that in text format the timestamptz is returned > properly converted. Also note that Timetz results are converted correctly > regardless of the result set format (binary or text.) A quick look at timestamptz_send and timetz_send shows that they both just send the internal representation; there isn't any intent to do any sort of timezone adjustment. Even if there were some reason to argue that this is wrong, the behavior is of sufficiently long standing that I doubt we could change it. > The documentation seems to state that Timestamptz fields will be returned > converted to the currently set timezone session property and doesn't mention > the above behavior. Since, in general, we don't document binary representations in any detail, I doubt that there is any such statement made intentionally. Text output behaves that way, for sure, but if you see something claiming that it also happens for binary output then we need to tweak the docs. regards, tom lane