Timestamp input + copy

Поиск
Список
Период
Сортировка
От Kevin Bartz
Тема Timestamp input + copy
Дата
Msg-id 20040728221644.A42F23FE8B@omta16.mta.everyone.net
обсуждение исходный текст
Ответы Re: Timestamp input + copy  (Steve Crawford <scrawford@pinpointresearch.com>)
Список pgsql-general
Hi Postgressers! I really like Postgres. Thanks for all your work on it. I
just have a problem with the way it's handling my flat file's timestamp
columns.

I have a flat file with a column with dates formatted like this:

2004-04-15 18:04:26 PM

It's a bit strange, I know, but I didn't create the file. My idea of
Postgres's proper behavior would be to load this date as a military time
(and ignore the "PM"). MS SQL Server behaves in this way. Postgres, however,
won't even load the file:

bonusticket=copy bonusticket2004Q2 from
'/home/kevin/bonusticket/data3/uberfile/uberfile1.txt' null as '';
# ERROR:  date/time field value out of range: "2004-04-15 18:04:26 PM"
CONTEXT:  COPY bonusticket2004q2, line 17, column submit_date: "2004-04-15
18:04:26 PM"

I presume that Postgres is complaining about the fact that I have an 18 in
the hour slot of a supposedly PM time. What can I do about this? Can I
possibly specify a time format (similar to the 'YYYY-MM-DD HH24:MI:SS' I
might pass to to_timestamp) at load time?

Thanks for any help you can provide,

Kevin


В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: php -postgresql
Следующее
От: "Chris Smith"
Дата:
Сообщение: Re: Timestamp input + copy