Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-29 Thread Adrian Klaver
On Thursday 29 November 2007 2:40 pm, Ivan Sergio Borgonovo wrote: > On Tue, 27 Nov 2007 21:12:00 -0500 > > Lew <[EMAIL PROTECTED]> wrote: > > Lew wrote: > > >> Try eliminating the double quotes in the CSV file. "Wannabe" > > >> NULL would then be ,, (consecutive commas) > > >> in the CSV. From t

Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-29 Thread Ivan Sergio Borgonovo
On Tue, 27 Nov 2007 21:12:00 -0500 Lew <[EMAIL PROTECTED]> wrote: > Lew wrote: > >> 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. >

Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-29 Thread Lew
Lew wrote: 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. Ivan Sergio Borgonovo wrote: Exactly what I did because fortunately there weren't too

Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-27 Thread Ivan Sergio Borgonovo
On Sun, 25 Nov 2007 13:22:48 -0500 Lew <[EMAIL PROTECTED]> 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 quote

Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-27 Thread Lew
Ivan Sergio Borgonovo wrote: 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

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

2007-11-25 Thread Ivan Sergio Borgonovo
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 str