Re: Issue with to_timestamp function

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Lou Oquin <LOquin(at)nammotalley(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Issue with to_timestamp function
Date: 2014-09-08 23:34:47
Message-ID: CANu8FixQapp9oNZxOc0NEJWh3CG0isGU=DzrK9gCVaOWnkh2nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-09-09 00:13:08 Re: Issue with to_timestamp function
Previous Message Lou Oquin 2014-09-08 23:18:41 Re: Issue with to_timestamp function