Re: Issue with to_timestamp function - Mailing list pgsql-general

From Melvin Davidson
Subject Re: Issue with to_timestamp function
Date
Msg-id CANu8FixQapp9oNZxOc0NEJWh3CG0isGU=DzrK9gCVaOWnkh2nw@mail.gmail.com
Whole thread Raw
In response to Issue with to_timestamp function  (Lou Oquin <LOquin@nammotalley.com>)
List pgsql-general

>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.


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Issue with to_timestamp function
Next
From: Adrian Klaver
Date:
Subject: Re: Issue with to_timestamp function