Search Postgresql Archives

Re: Issue with to_timestamp function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux