Re: CSV file - Using COPY Command - Double-Quotes

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: CSV file - Using COPY Command - Double-Quotes
Дата
Msg-id 200512062017.jB6KHhM00893@candle.pha.pa.us
обсуждение исходный текст
Ответ на CSV file - Using COPY Command - Double-Quotes  (Walter <pgsql@thejohnsonplace.com>)
Ответы Re: CSV file - Using COPY Command - Double-Quotes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Walter wrote:
> I have a problem using the copy command on a CSV file.
>
> All of the values within the CSV are surrounded with quotation marks. So
> a null value for a field looks like ""

It should be ,, for NULL.

> I am trying to import the file and no matter what I do, it hits a null
> date field and says
>
> invalid input syntax for type date : ""

Have you tried WITH NULL AS ''?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Walter
Дата:
Сообщение: CSV file - Using COPY Command - Double-Quotes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CSV file - Using COPY Command - Double-Quotes