Re: \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: Re: \copy ... with null as '' csv doesn't get nulls
Date: 2007-11-27 18:08:34
Message-ID: 20071127190834.7680c83d@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 25 Nov 2007 13:22:48 -0500
Lew <lew(at)lwsc(dot)ehost-services(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-27 18:10:35 Re: Non-unique values problem after 'add column'
Previous Message Никоноров Григорий 2007-11-27 18:01:12 Re: [GENERAL] Error while compiling PostgreSQL with Java