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 1wGFzp-0062hQ-2Z for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Apr 2026 12:51:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wGFzn-006XPV-2l for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Apr 2026 12:50:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wGFzn-006XPJ-1U for pgsql-bugs@lists.postgresql.org; Fri, 24 Apr 2026 12:50:59 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wGFzl-00000002ZqW-1ueA for pgsql-bugs@lists.postgresql.org; Fri, 24 Apr 2026 12:50:58 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-79a46ebe2beso79822577b3.2 for ; Fri, 24 Apr 2026 05:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777035057; cv=none; d=google.com; s=arc-20240605; b=T8+RaqMlGBb64NKP4GnOX8j2ONwSRFMFqcoCWUQptyzwPBQXtOmHEz8hZILKJAP11q F/ZwxUg1NOvQ3SMJtKfVu6/aeSHUHLAjsBMCjzpzMzqJ43BAOfmRXPIGFn2zNtC7zGyf mQf08ijDYKTl+CdCk0Pp9FFpPDWR06e1/gasTuGuJIH3zNbf2ABzDGiMayOD0sJYS8mI v7ohLYypuTW12C2DA3g84D8DyjRfd5ATW52hxMgWpIdkJ/DQUiQom1PJGCKyh2+cSDd0 Qn/BZJ7awPsrvJ9XaIhZ28P7c0vlzvo85h0dsEbJ14xKab41sm7nlVkMDRpPieaNQdGM LD5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=0xu3aYKMStLJ7AOUYq0l64d+trEJdUVZc1LcVt9Tq/Q=; fh=tPcRbRRVXTnyzKiNSuMOsJvGzRwDfisUOHyZhHFAfdY=; b=TRjphdVszflbgsZTA6am6CcFPQs2Z7jncy1WpVJpPwksFJLjAxobRh4bfLUsmh/We7 VhJR8mHuZmLC1ki/is7Vitb/WncoQHT/NePTEN6WD97xM5OWdPMTduHWKKG/nzK+ZErs XXE4+Sh1MGYbABCUimjWbYiqAUQxwdDdM9YKoWtNBu7okUcGnPOCapDMw+DzqYAOZ7fH 7p9vK4KNZcFq2stsou4VE4+DQtu4TEfS0rWMUzuuNF2cpBPIx9C+4WkhXJsqaPacdATd wSvwCsKa334CpFpM8BLLC3mNRSp2Mufk1rHl0D4d9YwXV4gudOFw3eLzWVc50x0iULAY zAFg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777035057; x=1777639857; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0xu3aYKMStLJ7AOUYq0l64d+trEJdUVZc1LcVt9Tq/Q=; b=XJgHBbVF5GfMG0bVIulGE/fwnwiGYIiluEBhrbUC5dswqBniEDtVRD/o8Uc8IxFbf+ RuP2jgaWerneYzWwKwgJtOEUQrivzuc6b4SeaYUGzd8VbreGIlEUpfPr4zdT0ncIcyut TF1vBxzr6ZwZGoB18SOcf9XVq8tEBLymq3f4KVuQ8PA84xoW2vtFk5hcpaI9expCMCCV x4Gu+BuE6b/AH+W9OZm1M3wzGXeDHDMUwuWc1EvgpmVk6P13oWJWiabzCA3nR9PEiMwL T3tjD6vSHKX2k5q/GHZBXIcCFxSuqmkfTp8kRlgr+8+01ya4q0y20RrO75U+pcWy8tzP RcBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777035057; x=1777639857; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0xu3aYKMStLJ7AOUYq0l64d+trEJdUVZc1LcVt9Tq/Q=; b=cFr2l0x/d9kPga9jUMENmArm1mdi3ol4sioBDQQ+I3GHoIDo16ouaSe2e0mpMh3hhU dCeOcFXmaPfOtLJ6b7xjPF8SRCY4w2Y7rOyx6Rz6ncHnrQfL8XRL7rfe4PU6b9sLGeGJ /vOOn7TCd1XpmG7y3XvGCqZFEwIjgktRC1yyYqJx/1wgfLnJG/l9PkPuGSl844x3UI8i V3n0KkAFcelKfHZpDY4Xp0rgaHVH1fvVXNHbTcsxdIuNgxyrNusdcjbwUbLFgsHdyKgi KASJFcF9virE9P9SRSZLDOMQ+7trzogLx1JRAlAd2UVr+CG5C5XoQU0DZiKa+24qwoPo SNYw== X-Forwarded-Encrypted: i=1; AFNElJ9ZDa0Cdp4Fh6eQOy4sJ5UtgSOps5+lFbuNhwjDaReXUIRH+30mok2jW9TMci3dNae5bxBCRVQvQHMC@lists.postgresql.org X-Gm-Message-State: AOJu0YzZhfA5gw16JHdvw3mrfI5duh2W5HtLIEp6vWfofFRSkBZBCSBR bum0W3C09/l6/I9TbxHGUPwUrqjRFQYuNprOVqe7G6JogOn8Jru16O8yUlTuEJuddq6YinJtbXS 59f0AhS4G1XxBQE8VNsuh+2WtRdK/6ZU= X-Gm-Gg: AeBDieuVE0y83MeYxcUcPvplSJ6f7L6I5AWgYF7DuV4Mv5TdU79wstg6aGaWOLy/h24 CvElnpS1446P9eHou/ch/cmZLLYLb1ixhiFtHOY9u8Mdmrc5YCXgsI0Q8ZeITO8+FIu8wWM8D31 QM24MAeHv8p0HQWp2QDtLqLRLVFeLdul0tPknPzrQ8/FA57vxD8zgOwvTgPR2kYRZBwoY2hOVQX NnjpHEWJpoVswFyFsiUNlTWEYwQCTyYGJe5YoFQVicUBBzCQ+WXIr/lc2IIRfTDuKz04NGeTHOW Cq7Gy7KrTcUACVhUbJWpBsi5l3Usz8THk0mXDvY8j51RlmF0lg== X-Received: by 2002:a05:690c:698a:b0:7b8:f152:7545 with SMTP id 00721157ae682-7b9ece7a0e0mr302854437b3.9.1777035057054; Fri, 24 Apr 2026 05:50:57 -0700 (PDT) MIME-Version: 1.0 References: <1444609.1776958814@sss.pgh.pa.us> <1B595919-2596-4CB3-BC39-DDCCB9876E56@yesql.se> In-Reply-To: <1B595919-2596-4CB3-BC39-DDCCB9876E56@yesql.se> From: Ayush Tiwari Date: Fri, 24 Apr 2026 18:20:45 +0530 X-Gm-Features: AQROBzDtw6TySANiqgsht30wrkJdlmrXUtDkeQG4-KSUQpJ1Ap2b5b-QQNCEDwE Message-ID: Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0 To: Daniel Gustafsson Cc: Michael Paquier , Tom Lane , pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000005447670650343776" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005447670650343776 Content-Type: text/plain; charset="UTF-8" On Fri, 24 Apr 2026 at 18:14, Daniel Gustafsson wrote: > > On 24 Apr 2026, at 11:13, Ayush Tiwari > wrote: > > > Attached patch, please review. > > 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. > Looks good to me. Thank you! Regards, Ayush --0000000000005447670650343776 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, 24 Apr = 2026 at 18:14, Daniel Gustafsson <dan= iel@yesql.se> wrote:
> On 24 Apr 2026, at 11:13, Ayush Tiwari <ayushtiwari.slg01@gmail.c= om> wrote:

> Attached patch, please review.

LGTM for the most part, I don't really think we need to use both to_dat= e and
to_timestamp though, we can save a few cycles there.=C2=A0 I rewrote the co= mments to
match the rest of the file, and moved to where to where we test for year 00= 00
since it seems like a better place.=C2=A0 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 fr= ee.

Looks good to me. Thank you!

Regards,Ayush=C2=A0
--0000000000005447670650343776--