Re: Timestamp comparison with string in some special cases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dragan Matic <mlists(at)panforma(dot)co(dot)yu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Timestamp comparison with string in some special cases
Date: 2007-11-19 17:16:29
Message-ID: 2115.1195492589@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dragan Matic <mlists(at)panforma(dot)co(dot)yu> writes:
> And isn't this:

> SELECT * from table where timestamp_column < to_timestamp('11/19/2007
> 15:46:09 PM','MM/DD/YYYY HH24:MI:SS')

> just doing the same thing that implicit string to timestamp conversion
> should have done in the first case?

No. The entire reason for existence of to_timestamp() is to accommodate
translation of formats that are too weird, ambiguous, or inconsistent
to be reasonable for the main timestamp input code to accept.
(Like this one.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2007-11-19 17:20:20 Re: [GENERAL] Error while starting postgreSQL service
Previous Message Sam Mason 2007-11-19 17:14:42 Re: Timestamp comparison with string in some special cases