New to_timestamp implementation is pretty strict - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject New to_timestamp implementation is pretty strict
Date
Msg-id 4933D3A7.702@enterprisedb.com
Whole thread Raw
Responses Re: New to_timestamp implementation is pretty strict  ("David E. Wheeler" <david@kineticode.com>)
Re: New to_timestamp implementation is pretty strict  ("Brendan Jurd" <direvus@gmail.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Looking for someone with MinGW
Next
From: "Pavel Stehule"
Date:
Subject: Re: WIP: default values for function parameters