Re: copy in date string "00-00-00 00:00:00"

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: copy in date string "00-00-00 00:00:00"
Дата
Msg-id CAOR=d=2TGo0-8a7Qm1ojn+5YJCrW-ZcxDEZOhUvu8Cgp+rn1TA@mail.gmail.com
обсуждение исходный текст
Ответ на copy in date string "00-00-00 00:00:00"  (Mark Phillips <Mark.Phillips@mophilly.com>)
Ответы Re: copy in date string "00-00-00 00:00:00"  (Andy Colson <andy@squeakycode.net>)
Список pgsql-general
On Wed, Mar 14, 2012 at 6:47 PM, Mark Phillips
<Mark.Phillips@mophilly.com> wrote:
> I am migrating a data set from Oracle 8i to PG 9.1. The process is to export data into csv files, then use the pg
"copytable from file csv header" statement to load the tables. 
>
> There are a number of date columns in the tables that include empty value (null), valid dates, and some with the time
componentonly. The empty values are being output as 00-00-00 00:00:00. 
>
> The import is falling over on rows that contain these "zero" dates.
>
> I can adjust the NLS session format of the date string, within a small range, in the oracle environment. However,
eachform I have attempted still results in these "zero" date values in the csv file. 
>
> I am thinking of run the csv files through a filter to change the "00-00-00 00:00:00" to an empty value.
>
> Is there a way for postgres to handle this?

Can you run it through sed and replace the "0000-00-00 00:00:00" to
NULL (no quotes) ?  That should work.

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

Предыдущее
От: Mark Phillips
Дата:
Сообщение: copy in date string "00-00-00 00:00:00"
Следующее
От: Andy Colson
Дата:
Сообщение: Re: copy in date string "00-00-00 00:00:00"