Re: Cannot dump/restore text value \N

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cannot dump/restore text value \N
Дата
Msg-id 15628.1065395570@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Cannot dump/restore text value \N  (Manfred Koizar <mkoi-pg@aon.at>)
Ответы Re: Cannot dump/restore text value \N  (Manfred Koizar <mkoi-pg@aon.at>)
Re: Cannot dump/restore text value \N  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-hackers
Manfred Koizar <mkoi-pg@aon.at> writes:
> To be clear, this is not about \N as the default external
> representation for NULL, I'm talking about a string consisting of the
> two characters backslash and uppercase-N.

Now that I look at it, this must have been broken since the beginning of
time, or at least since we made the null representation configurable.
Surprising no one noticed before.

The problem is that the WITH NULL string is compared to the attribute
value *after* debackslashing, and so there is no way to prevent a match
to an actual valid data string.

In older code it seems that the representation of NULL as \N was
hardwired, and this was tested for in the process of debackslashing,
so that the valid data string \\N wouldn't be mistaken for \N.

For the purposes of recognizing the default \N null representation,
it seems we have to compare the null representation string to the
pre-debackslashing input.  (This is probably fairly easy to make happen
in CVS tip, but it might be pretty painful in 7.3.)  Arguably this is
the right semantics because in the other direction we don't backslash
the outgoing null-representation string.  I wonder whether it would
break any existing apps though.

Comments?
        regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Open 7.4 items
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql-server/src/backend/catalog aclchk.c