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

From: <operationsengineer1(at)yahoo(dot)com>
To: Walter <pgsql(at)thejohnsonplace(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: CSV file - Using COPY Command - Double-Quotes
Date: 2005-12-06 21:16:50
Message-ID: 20051206211650.51092.qmail@web33302.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

--- Walter <pgsql(at)thejohnsonplace(dot)com> 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 ""
>
> 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 : ""
>
> How do I get the copy command to simply enter a null
> value for the "" it
> finds for the date field in the CSV file?
>
> BTW - None of my fields are set as "NOT NULL". They
> can all accept null
> values.
>
> Please help.
>
> Walter
> PG Noob

Walter, why not import the file into OOo Calc (or a
spreadsheet of your choice) and remove all the "
characters?

you can then export as a CSV and it should work just
fine.

best of luck.


__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel T. Staal 2005-12-06 21:23:37 Re: CSV file - Using COPY Command - Double-Quotes
Previous Message Walter 2005-12-06 21:15:46 Re: CSV file - Using COPY Command - Double-Quotes