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 1pk0Ic-0002S1-DN for pgsql-general@arkaria.postgresql.org; Wed, 05 Apr 2023 10:23:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk0Ib-00026T-8E for pgsql-general@arkaria.postgresql.org; Wed, 05 Apr 2023 10:23:29 +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 1pk0Ia-00026K-U6 for pgsql-general@lists.postgresql.org; Wed, 05 Apr 2023 10:23:28 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pk0IX-0010zE-Qr for pgsql-general@lists.postgresql.org; Wed, 05 Apr 2023 10:23:28 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Ps11M3LVQz9sQx; Wed, 5 Apr 2023 12:23:19 +0200 (CEST) Date: Wed, 5 Apr 2023 12:23:18 +0200 (CEST) From: Erik Wienhold To: Steve Rogerson , pgsql-general list Message-ID: <2134938884.639895.1680690198796@office.mailbox.org> In-Reply-To: References: Subject: Re: Possible old and fixed bug in Postgres? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4Ps11M3LVQz9sQx List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 05/04/2023 11:18 CEST Steve Rogerson wrote: > > I was looking at perl CPAN Module (DateTime::Format::Pg) and saw that it = did=20 > something that seemed odd to me with time zones, based on the comment: > > =C2=A0=C2=A0=C2=A0 # For very early and late dates, PostgreSQL always re= turns times in > =C2=A0=C2=A0=C2=A0 # UTC and does not tell us that it did so. > > Early is before 1901-12-14 and late after 2038-01-18 > > A quick test setting my time zone to be America/Chicago I got > > select '1900-01-01 00:00:00'::timestamptz; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 timestamptz > ------------------------ > =C2=A01900-01-01 00:00:00-06 > (1 row) > > and > > select '2040-01-01 00:00:00'::timestamptz; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 timestamptz > ------------------------ > =C2=A02040-01-01 00:00:00-06 > > > These seemed correct to me. I'm guessing this might have been a bug/featu= re of=20 > pg in the long ago. Judging by the commit message and changed test cases, probably: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommit;h=3D921d74= 9bd4c34c3349f1c254d5faa2f1cec03911 -- Erik