Re: CSV file - Using COPY Command - Double-Quotes - Mailing list pgsql-novice

From Bruce Momjian
Subject Re: CSV file - Using COPY Command - Double-Quotes
Date
Msg-id 200512062017.jB6KHhM00893@candle.pha.pa.us
Whole thread Raw
In response to CSV file - Using COPY Command - Double-Quotes  (Walter <pgsql@thejohnsonplace.com>)
Responses Re: CSV file - Using COPY Command - Double-Quotes  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Walter
Date:
Subject: CSV file - Using COPY Command - Double-Quotes
Next
From: Tom Lane
Date:
Subject: Re: CSV file - Using COPY Command - Double-Quotes