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