Re: \copy ... with null as '' csv doesn't get nulls - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: \copy ... with null as '' csv doesn't get nulls
Date
Msg-id 20071127190834.7680c83d@webthatworks.it
Whole thread Raw
In response to Re: \copy ... with null as '' csv doesn't get nulls  (Lew <lew@lwsc.ehost-services.com>)
Responses Re: \copy ... with null as '' csv doesn't get nulls  (Lew <lew@lwsc.ehost-services.com>)
List pgsql-general
On Sun, 25 Nov 2007 13:22:48 -0500
Lew <lew@lwsc.ehost-services.com> wrote:

> I went to the docs for COPY and they say,
> > The default is \N (backslash-N) in text mode, and a empty value
> > with no quotes in CSV mode.

> That "with no quotes" phrase caught my attention.

> Try eliminating the double quotes in the CSV file.  "Wannabe" NULL
> would then be ,, (consecutive commas)
> in the CSV.  From the docs, you don't even need the "NULL AS"
> clause in your COPY statement.

Exactly what I did because fortunately there weren't too many chances
of weird stuff in 2000 records (sed -e 's/,""/,/g').

Anyway with NULL AS '' and without it I can't still import NULL
without pre-processing.

I thought it may be missing total support of UTF-8 or if I did
something wrong or it is actually a "feature".

thx

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


pgsql-general by date:

Previous
From: SHARMILA JOTHIRAJAH
Date:
Subject: Re: postgres 8.3 beta 2 storage question
Next
From: Никоноров Григорий
Date:
Subject: Re: Error while compiling PostgreSQL with Java