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

Поиск
Список
Период
Сортировка
От Lew
Тема Re: \copy ... with null as '' csv doesn't get nulls
Дата
Msg-id r7adnUAsNJ3tU9HanZ2dnUVZ_h7inZ2d@comcast.com
обсуждение исходный текст
Ответ на Re: \copy ... with null as '' csv doesn't get nulls  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: \copy ... with null as '' csv doesn't get nulls
Список pgsql-general
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 many chances
> of weird stuff in 2000 records (sed -e 's/,""/,/g').

And this worked, right?

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

What pre-processing is that?

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

This clearly has nothing to do with UTF-8, and everything to with comma-comma
representing a NULL and comma-quote-quote-comma representing an empty string.

--
Lew
This post contained two requests for responses.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Guillaume Pungeot"
Дата:
Сообщение: Threads limit for postmaster
Следующее
От: Trent Shipley
Дата:
Сообщение: Re: PostgresSQL vs. Informix