Re: COPY incorrectly uses null instead of an empty string in last field

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: COPY incorrectly uses null instead of an empty string in last field
Дата
Msg-id 5719.1014759846@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: COPY incorrectly uses null instead of an empty string  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-hackers
> The original reporter's mail had no tabs at all, but it was not an
> attachment and it had had lost all its tabs along the way.  His input
> script came from 7.0 pg_dump.  I am following up with him whether there
> are actually tabs before the empty fields in that pg_dump output.

If a trailing tab got lost in a dump file, then COPY IN would silently
assume that fields after the tab position should be NULL.  I suspect
that that is what happened here.  Probably some "helpful" program
stripped trailing whitespace from the file.

One of the things we've agreed to do in 7.3 is change COPY IN to remove
that assumption --- a line with too few fields (too few tabs) will draw
an error report instead of silently doing what's likely the wrong thing.
        regards, tom lane


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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: COPY incorrectly uses null instead of an empty string
Следующее
От: Jean-Michel POURE
Дата:
Сообщение: Re: PostgreSQL 8.0 ??