Re: ASCII Null control character validation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ASCII Null control character validation
Дата
Msg-id 85266.1512052543@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ASCII Null control character validation  (Alexey Chernyshov <a.chernyshov@postgrespro.ru>)
Список pgsql-hackers
Alexey Chernyshov <a.chernyshov@postgrespro.ru> writes:
> I found in src/backend/utils/mb/wchar.c: pg_verify_mbstr_len() that it
> reports ASCII Null character (\000) as invalid. As for me, it should
> pass validation.

This is intentional and we're not going to change it.  There is too
much code in the backend that relies on NUL-terminated strings ...

> However, ASCII Null character breaks a line and the
> end of the line is missed, try:
> INSERT INTO mytable VALUES (E'a\001b\000c and rest of line MIA');

... like that for instance.  See (many) past discussions of this issue.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] postgres_fdw bug in 9.6
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] create_unique_path and GEQO