I don't think the changes made in PG 12 are documented accurately. It
currently says:
to_timestamp and to_date matches any single separator in the input
string or is skipped
However, I think it is more accurate to say _multiple_ whitespace can
also be matched by a single separator:
SELECT to_timestamp('%1976','_YYYY');
to_timestamp
------------------------
1976-01-01 00:00:00-05
SELECT to_timestamp('%%1976','_YYYY');
ERROR: invalid value "%197" for "YYYY"
DETAIL: Value must be an integer.
-- two spaces
--> SELECT to_timestamp(' 1976','_YYYY');
to_timestamp
------------------------
1976-01-01 00:00:00-05
--> SELECT to_timestamp(E'\t\t\t1976','_YYYY');
to_timestamp
------------------------
1976-01-01 00:00:00-05
Proposed patch attached.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +