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 1wHGJD-0070SL-1r for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Apr 2026 07:23:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wHGJC-00Cg7l-1m for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Apr 2026 07:23:10 +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 1wHGJC-00Cg7d-0z for pgsql-bugs@lists.postgresql.org; Mon, 27 Apr 2026 07:23:10 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wHGJA-00000003IU0-0djl for pgsql-bugs@lists.postgresql.org; Mon, 27 Apr 2026 07:23:10 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8B985140005A; Mon, 27 Apr 2026 03:23:06 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 27 Apr 2026 03:23:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1777274586; x=1777360986; bh=fNSlWX1Wtb t8vFZlB4fuvPvrdshPSaSC1b+7B/QXyPM=; b=Ep5cGqysl9TQ2tWDZE1fC400E/ 5jcOjqfNAv4ZkD03Fgzj8p3IkibovU4l9ParajIM0Ch75JPN5144TI0i71X1Lvqv 50sv44wg/sOu/xj4rfMETiyj2TL9PevdSQjNFuNYl3EigTRBPKUkwatDmqurtWfu mBu6QKSGS54y4gsgASbFvW0o1kAoI4tzV59g8ct/NIHCHNQ1R7TELLzjq8O/XMBp fn8e+m+AXcI1Aj8ts4M8nbV9pbGgBdhcuutoczOxKOz89lSA6PfFdlLo0d4VK8PQ gABnO/YaJ+MQjW/nas4Jfl7p4H3L9mdUzrHSR/OS2uMCAqZVUXomEXJBvjJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1777274586; x=1777360986; bh=fNSlWX1Wtbt8vFZlB4fuvPvrdshPSaSC1b+ 7B/QXyPM=; b=ccWfTuBxjsDoOXUkeq2/yh8FaSjDBSumcrEo8HrA5nlqoe3A4lf n6yHhblQRat5n8ZVCVLwxvjdAbAnFRCjjo9V4jf7fYsXqUFN8dq2IHXc86nJIu9h OfCdB6xsgOAB/zPdtQlrQNi/oO64TQWqB+vhvDOXFonSk1DEkGq37UMastGD1EOy uk4dNIbRsQL44OnO6FPDZRHHqckVGfqM6PcmFIxLlND/HAUw6JNToVf+HQu9ygzQ MoSITkgan9rZrWkC0NFkUK/il4Quzzdn11g9siJqR4bTA/RUY1X9zNK2lhqfaTsa FpfRhMWKiMh65H2bWCCpuDa9xGCg235CYfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdejkedtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegurghnih gvlheshigvshhqlhdrshgvpdhrtghpthhtoheprgihuhhshhhtihifrghrihdrshhlghdt udesghhmrghilhdrtghomhdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruh hspdhrtghpthhtohepphhgshhqlhdqsghughhssehlihhsthhsrdhpohhsthhgrhgvshhq lhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Apr 2026 03:23:04 -0400 (EDT) Date: Mon, 27 Apr 2026 16:23:01 +0900 From: Michael Paquier To: Daniel Gustafsson Cc: Ayush Tiwari , Tom Lane , pgsql-bugs@lists.postgresql.org Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0 Message-ID: References: <1444609.1776958814@sss.pgh.pa.us> <1B595919-2596-4CB3-BC39-DDCCB9876E56@yesql.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9gUoB0IdXOpycywT" Content-Disposition: inline In-Reply-To: <1B595919-2596-4CB3-BC39-DDCCB9876E56@yesql.se> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9gUoB0IdXOpycywT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 24, 2026 at 02:44:04PM +0200, Daniel Gustafsson wrote: > LGTM for the most part, I don't really think we need to use both to_date and > to_timestamp though, we can save a few cycles there. I rewrote the comments to > match the rest of the file, and moved to where to where we test for year 0000 > since it seems like a better place. Also took the liberty to use year 100 in > one of the testcase, while the year is superfluous for the test in question, > year 100 was previously untested so this will increase test coverage for free. That seems fine to me. If we decide to change this behavior later on and error on these pattern, at least we'll know about them. -- Michael --9gUoB0IdXOpycywT Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnvDtUACgkQnvQgOdby QH1qMw//QnQ0XA1W0NhqvqZU18XckCsVfYb7Dc2x8Upt2hWpmuDqBwXPU+uOQKRE 984FwtvSfqu5pN3owzi8xlR/LL0JcyKlF4uI6AMScCrrhNqGLXkCHKlzqYWTnJeY AZGkQ2uhOoPatatBcGPcTu+I7AUIivwWWFyHufK53vewSqM6vNBCq7nwFOgZWvim lUoW+8wYkUo1LMuaUhBSfQThdoVJQjPV3wTpTuyhazuwNigRYZzc2dPlZdWN9Ygd fQybTsLjX77SNDV2mxWDb/0pUr+5CZnjJr7Jg/ILK4A6OTy+t+itw6C+NJSxG8Pj VLDR/RyeIww8fZjKkm+VRs1p7CsprRN8Yvxlas26VUMOICA62C812R8F4l0F+6Jk QgPz57sHXPkPDLz7OfoYDxe54rEwgOix3gCeo8B46epe+KeyBz0/MHUgnrfZuX4b MAVO5EbgaIP/0PRmrUYqG+w2WAOJRUI1okT6xU0jGV3XC50+Hu8GLiAXB7SvYpw2 3rdLfvoU+mZWSyzCNg2vnI9vsif8+miKTxkmgCxZxRHNl/jOFkLURRWWpybx1v4/ 3KTLeUUSMau98hrGW+84B9WBZC55nWOd0Rk38qLLVdHRJU3w7rp62UWdXAqnfEJ8 sE1d7q7iqkA28lTsaxARoCuDXIJr+LyzT1oRfGzhFQaR4DDabkw= =npdR -----END PGP SIGNATURE----- --9gUoB0IdXOpycywT--