\copy ... with null as '' csv doesn't get nulls

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: \copy ... with null as '' csv doesn't get nulls
Date: 2007-11-25 17:39:32
Message-ID: 20071125183932.600ff98d@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd expect this:

\copy tablename from 'filename.csv' WITH NULL as '' CSV HEADER

whould import "" as NULL.

The input file is UTF-8 (not Unicode/UTF-16).
I checked the hexdump and the "wannabe" NULL are actually
2c 22 22 2c -> ,"",

all fields are varchar that admit NULL

but still I get empty strings ('') in spite of NULL.

Am I missing something or it is a well known "feature"?

thx

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2007-11-25 18:01:29 Re: EAV or not to EAV?
Previous Message Никоноров Григорий 2007-11-25 17:39:28 Re: Error while compiling PostgreSQL with Java