Mysteries of the future
The Post Office <noreply@postgresql.org>
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: y.saburov@gmail.com
Date: 2024-04-10T15:00:22Z
Lists: pgsql-docs
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/16/functions-formatting.html
Description:
I'm not sure that there will be 31 days in 11 months; although postgresql
probably knows better what will happen in 20000
For example (with the year 20000): to_date('200001131', 'YYYYMMDD') will be
interpreted as a 4-digit year; instead use a non-digit separator after the
year, like to_date('20000-1131', 'YYYY-MMDD') or to_date('20000Nov31',
'YYYYMonDD').
https://www.postgresql.org/docs/current/functions-formatting.html
```sql
SELECT to_date('20000-1131', 'YYYY-MMDD');
ERROR: 22008: date/time field value out of range: "20000-1131"
LOCATION: DateTimeParseError, datetime.c:4021
```
Commits
-
Doc: fix bogus to_date() examples.
- 7924036cbb2f 12.19 landed
- 164c945c3864 13.15 landed
- da11a14e0c79 14.12 landed
- 268e723b12fa 15.7 landed
- e177da5c87a1 16.3 landed
- 6d4f06271495 17.0 landed