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.94.2) (envelope-from ) id 1tNZYD-000hdx-Hp for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2024 15:31:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tNZYC-002uTr-Gd for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2024 15:31:56 +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.94.2) (envelope-from ) id 1tNZYC-002uTi-88 for pgsql-bugs@lists.postgresql.org; Tue, 17 Dec 2024 15:31:55 +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.94.2) (envelope-from ) id 1tNZY9-000DUB-4V for pgsql-bugs@postgresql.org; Tue, 17 Dec 2024 15:31:55 +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 4BHFVopt2236660; Tue, 17 Dec 2024 10:31:50 -0500 From: Tom Lane To: myzhen cc: pgsql-bugs@postgresql.org Subject: Re: to_timestamp function calculation error In-reply-to: <4833ac30.18d0.193d475b6d3.Coremail.zhenmingyang@yeah.net> References: <4833ac30.18d0.193d475b6d3.Coremail.zhenmingyang@yeah.net> Comments: In-reply-to myzhen message dated "Tue, 17 Dec 2024 19:51:44 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2236658.1734449510.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 17 Dec 2024 10:31:50 -0500 Message-ID: <2236659.1734449510@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk myzhen writes: > When calling the to_timestamp function, if the actual parameter passed i= s a negative year and you specify BC, this will cause to_timestamp to retu= rn an AD date. I believe this is intentional. regards, tom lane