I like strict in general, but this doesn't seem logical:
postgres=# SELECT to_timestamp('29-12-2005 01:2:03', 'DD-MM-YYYY
HH24:MI:SS'); -- works
to_timestamp
------------------------
2005-12-29 01:02:03+02
(1 row)
postgres=# SELECT to_timestamp('29-12-2005 01:02:3', 'DD-MM-YYYY
HH24:MI:SS'); -- doesn't work
ERROR: source string too short for "SS" formatting field
DETAIL: Field requires 2 characters, but only 1 remain.
HINT: If your source string is not fixed-width, try using the "FM"
modifier.
I think the end of string should be treated like a field separator,
colon in this example, and we should accept both of the above. Opinions?
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers