út 10. 5. 2022 v 6:28 odesílatel 正华吕 <kainwen@xxxxxxxxx> napsal:
Hi,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.Go through the code, postgres use date_in to do the cast, and firstly use last 2 chars toget the day, and the 2 chars to get the month, and all remaining chars as year.The question here is: should we throw error for such input? Or what standard postgres isusing to cast such kind of string?
This is ISO format
Regards
Pavel
Thanks.