Re: Quoted NULLs with COPY FROM

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Quoted NULLs with COPY FROM
Дата
Msg-id 43D5F11E.8070203@archonet.com
обсуждение исходный текст
Ответ на Re: Quoted NULLs with COPY FROM  ("George Pavlov" <gpavlov@mynewplace.com>)
Список pgsql-general
George Pavlov wrote:
>> Did you try NULL AS ''?
>
> yes i did. that is the default and does not change the outcome (same
> errors about trying to insert an empty string into a numeric field.

Well there's your problem. Quotes tend to imply a text field. Assuming
you don't want to write a short Perl script to pre-process the file the
simplest way would be to import into a temporary table with text columns
rather than numeric, then copy from that into the real table (with CASE
or two queries).

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: FATAL: terminating connection due to administrator
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Does this look ethical to you?