Problem with COPY CSV - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Problem with COPY CSV
Date
Msg-id 438E54E0.5010601@familyhealth.com.au
Whole thread Raw
Responses Re: Problem with COPY CSV  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Attached is a small test extract from the USDA nutrient database.

The problem is that the script won't load the COPY data correctly.  This
is with CVS HEAD (and 8.1).

It is the 4th column in the table that gives the problem (nutr_no
integer).  Each of the 3 COPY rows has a different way of specifying a
number:

* As an unquoted empty value
* As a quoted number
* As a quoted empty value

Now, I'm specifying "NULL AS ''" in the COPY command but it refuses to
recognize the quoted empty value as NULL.

Anyone have any ideas?  Is this a bug?  The manual even says that using
"NULL AS ''" lets you make no distinction between empty and quoted empty
values.

Chris

Attachment

pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: Upcoming PG re-releases
Next
From: David Fetter
Date:
Subject: Re: Upcoming PG re-releases