Re: Problem in converting int to timestamp value - why? - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem in converting int to timestamp value - why?
Date
Msg-id 19495.1095611486@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem in converting int to timestamp value - why?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Problem in converting int to timestamp value - why?  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> The leading space is confusing to_timestamp():

>   test=> SELECT to_timestamp(' 2004 12 17', 'YYYY MM DD');
>       to_timestamp
>   ---------------------
>    2171-11-06 06:00:00

I'd still say this is a bug.  If to_timestamp can't match the input to
the pattern, it should throw an error, not silently return garbage.

            regards, tom lane

pgsql-general by date:

Previous
From: Soeren Gerlach
Date:
Subject: Re: Problem in converting int to timestamp value - why?
Next
From: Tom Lane
Date:
Subject: Re: import/export or moving data between databases