Search Postgresql Archives

Re: Issue with to_timestamp function

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

 



>The data is

>

>ts

>08/06/2014 03:08:58

>08/06/2014 03:08:58

>08/06/2014 03:08:58

Hmmm, this works for me:

CREATE TABLE sql_log_import
(
  id serial NOT NULL,
  ts text, -- will convert to ts when merging into sql_server_logs
  CONSTRAINT sql_log_import_pk PRIMARY KEY (id)
)
WITH ( OIDS=FALSE );

INSERT INTO sql_log_import
VALUES
(1, '08/06/2014 03:08:58'),
(2, '08/06/2014 03:08:58'),
(3, '08/06/2014 03:08:58')

SELECT to_timestamp(ts, 'MM/DD/YYYY hh24:mi:ss')::timestamp FROM sql_log_import;

ts
2014-08-06 03:08:58
2014-08-06 03:08:58
2014-08-06 03:08:58


Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.



[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