Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Thu, 01 Dec 2005 09:41:52 +0800
  • Message-id: <438E54E0(dot)5010601(at)familyhealth(dot)com(dot)au>

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: test.sql.gz
Description: GNU Zip compressed data



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group