Re: Timestamp comparison with string in some special cases

Поиск
Список
Период
Сортировка
От Dragan Matic
Тема Re: Timestamp comparison with string in some special cases
Дата
Msg-id 4741C1E8.4060107@panforma.co.yu
обсуждение исходный текст
Ответ на Re: Timestamp comparison with string in some special cases  (Sam Mason <sam@samason.me.uk>)
Ответы Re: Timestamp comparison with string in some special cases  (Sam Mason <sam@samason.me.uk>)
Re: Timestamp comparison with string in some special cases  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Sam Mason wrote:
> On Mon, Nov 19, 2007 at 04:52:10PM +0100, Dragan Matic wrote:
>
>> select * from table where timestamp_column < '11/19/2007 15:46:09 PM'
>>
>
> Maybe the to_timestamp() function would help you:
>
>   SELECT to_timestamp('11/19/2007 15:46:09 PM','MM/DD/YYYY HH24:MI:SS')
>     -> 2007-11-19 15:46:09+00
>
> That just ignores the AM/PM flag, which may or may not be what you want
> to do.
>
>
>   Sam
>
>
>
Tnx, this helped a lot. But not, I am confused with something. I thought
there supposed to be an implicit conversion from string to timestamp in
the first case. 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?

Dragan Matic



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: [ADMIN] Error while starting postgreSQL service
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Compressed Backup too big