Re: Problem in converting int to timestamp value - why?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Soeren Gerlach <soeren(at)all-about-shift(dot)com>, pgsql-general(at)postgresql(dot)org, Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Subject: Re: Problem in converting int to timestamp value - why?
Date: 2004-09-19 16:31:26
Message-ID: 19495.1095611486@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-09-19 16:45:25 Re: import/export or moving data between databases
Previous Message Soeren Gerlach 2004-09-19 16:19:06 Re: Problem in converting int to timestamp value - why?