Re: Question on cast string to date - Mailing list pgsql-general

From 正华吕
Subject Re: Question on cast string to date
Date
Msg-id CANerzAd2Rop1_QLW5FLBLu7OMcEtuB9JR2BX4Bm2XQYcxDHGgg@mail.gmail.com
Whole thread Raw
In response to Re: Question on cast string to date  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Thanks all.

David G. Johnston <david.g.johnston@gmail.com> 于2022年5月10日周二 13:41写道:
On Monday, May 9, 2022, Tom Lane <tgl@sss.pgh.pa.us> wrote:
正华吕 <kainwen@gmail.com> writes:
>     I test the following SQL in pg15dev (seems same behavior as the
> previous version).
>     select '2020701'::date;
>     date
>    ------------
>     0202-07-01
>    (1 row)
>    At the first glance, the result seems quite strange.

[ shrug... ]  You left out a zero.  It's not apparent to me that
this answer is wrong. 

If you want to pursue this question, you could start by bisecting
to find just which commit changed it and why.


Manual history inspection of datetime.c



The goal seemed to be able to accept 5-digit years…this behavior change didn’t show in the tests (or discussion) though I didn’t look for the of testing the pre-existing failure mode.

David J.


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Question on cast string to date
Next
From: Tom Lane
Date:
Subject: Re: Question on cast string to date