Problem with COPY CSV

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Problem with COPY CSV
Date: 2005-12-01 01:41:52
Message-ID: 438E54E0.5010601@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
test.sql.gz application/x-gzip 276 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-12-01 02:21:43 Re: Upcoming PG re-releases
Previous Message David Fetter 2005-12-01 01:36:52 Re: [HACKERS] Upcoming PG re-releases