Hmm... I just tried it in Oracle and I got:
SQL> select to_date('2001-3-6','YYYY-MM-DD') from dual;
TO_DATE('2
----------
2001-03-06
That's where my initial confusion came from, cuz it seemed to work in oracle, but was not working in postgres.
In comparing the postgre & oracle docs, postgres says DD=(01-31) while oracle says DD=(1-31), so I guess each implementation is working properly - I just need to RTFM 😊
I agree that pg should at least throw an error, but it looking more closely, I can't get pg's to_date to complain about anything.
openacs=# select to_date('foo', 'YYYY-MM-DD');
to_date
---------------
0001-01-01 BC
(1 row)
So, perhaps this should be a feature request, not a bug? In any case, thanks for the help!