Re: Question on cast string to date

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: 正华吕 <kainwen(at)gmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Question on cast string to date
Date: 2022-05-10 06:03:59
Message-ID: 4043739.1652162639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Monday, May 9, 2022, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 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
> https://github.com/postgres/postgres/commit/7778ddc7a2d5b006edbfa69cdb44b8d8c24ec1ff

Ah, yeah, that looks plausible -- the previous code allowed 6 digits
YYMMDD or 8 digits YYYYMMDD, the new code allowed >= 6 digits with
2 or more YY followed by MMDD. So the specific case of YYYMMDD
was rejected before and not after. Doesn't seem to have been planned,
but it's not so obviously inconsistent that I'd care to break it
again nine years later. By now, somebody might be depending on it.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Masahiko Sawada 2022-05-10 07:02:05 Re: Support logical replication of DDLs
Previous Message 正华吕 2022-05-10 05:47:07 Re: Question on cast string to date