Re: Issue with to_timestamp function

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Issue with to_timestamp function
Дата
Msg-id 540E5219.5020303@aklaver.com
обсуждение исходный текст
Ответ на Issue with to_timestamp function  (Lou Oquin <LOquin@nammotalley.com>)
Ответы Re: Issue with to_timestamp function  (Lou Oquin <LOquin@nammotalley.com>)
Список pgsql-general
On 09/08/2014 01:52 PM, Lou Oquin wrote:
> I’ve imported a csv export of an MS SQL Server log file into a staging
> table on my local install of Postgresql (9.3/UTF8 encoding) for analysis.
>

>
> select to_timestamp(ts, 'MM/DD/YYYY hh24:mi:ss')::timestamp with time
> zone as tStamp
>
> from sql_log_import
>
> where id <= 10
>
> ********** Error **********
>
> SQL state: 22007
>
> Detail: Value must be an integer.
>
> Any Ideas?

To get that error I had to do something like this:

hplc=> select to_timestamp('aug/06/2014 03:08:58 ', 'MM/DD/YYYY
hh24:mi:ss');
ERROR:  invalid value "au" for "MM"
DETAIL:  Value must be an integer.

So at a guess, the data being imported has some month abbreviations in it.

>
> Thanks
>
> *Lou O’Quin*
>


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Issue with to_timestamp function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Crash in 9.4 Beta when partially collapsing left outer joins