Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vMbuH-00Eb1k-0E for pgsql-general@arkaria.postgresql.org; Sat, 22 Nov 2025 00:55:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vMbuF-00ATXz-2I for pgsql-general@arkaria.postgresql.org; Sat, 22 Nov 2025 00:55:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vMbuF-00ATXX-1F for pgsql-general@lists.postgresql.org; Sat, 22 Nov 2025 00:55:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vMbuD-000oXM-2E for pgsql-general@postgresql.org; Sat, 22 Nov 2025 00:55:15 +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 5AM0t8tS2555135; Fri, 21 Nov 2025 19:55:08 -0500 From: Tom Lane To: Laurenz Albe cc: Adrian Klaver , Steve Crawford , PG-General Mailing List Subject: Re: Unexpected date conversion results In-reply-to: <2e2a34695d84a297e62a2996466fecf97005a2fb.camel@cybertec.at> References: <2e2a34695d84a297e62a2996466fecf97005a2fb.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Sat, 22 Nov 2025 01:43:19 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2555133.1763772908.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 21 Nov 2025 19:55:08 -0500 Message-ID: <2555134.1763772908@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > I dug into the git history, and it has been like that since commit b3506= 006b564 > in 2002 (way before version 9.x). That commit fixed a bug that returned= ten > time the correct reault (but still offset from the UTC epoch). I didn't bisect, but I get this in 9.1.24: regression=3D# set timezone =3D 'America/Los_Angeles'; SET regression=3D# select to_timestamp(extract(epoch from current_date)); to_timestamp = ------------------------ 2025-11-21 00:00:00-08 (1 row) and this in 9.2.24: regression=3D# set timezone =3D 'America/Los_Angeles'; SET regression=3D# select to_timestamp(extract(epoch from current_date)); to_timestamp = ------------------------ 2025-11-20 16:00:00-08 (1 row) regards, tom lane