Re: Issue with to_timestamp function

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: Issue with to_timestamp function
Дата
Msg-id CANu8FixQapp9oNZxOc0NEJWh3CG0isGU=DzrK9gCVaOWnkh2nw@mail.gmail.com
обсуждение исходный текст
Ответ на Issue with to_timestamp function  (Lou Oquin <LOquin@nammotalley.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Issue with to_timestamp function
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Issue with to_timestamp function