Re: Invalid Unicode escape value at or near "\u0000"

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Invalid Unicode escape value at or near "\u0000"
Дата
Msg-id CA+hUKGLGU_wUWbfs3G2RXDmo5F0+fC4RX3c+SfpADV3+K+Q6OQ@mail.gmail.com
обсуждение исходный текст
Ответ на Invalid Unicode escape value at or near "\u0000"  (Japin Li <japinli@hotmail.com>)
Ответы Re: Invalid Unicode escape value at or near "\u0000"  (Andrew Dunstan <andrew@dunslane.net>)
Re: Invalid Unicode escape value at or near "\u0000"  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On Sat, Nov 13, 2021 at 4:32 PM Japin Li <japinli@hotmail.com> wrote:
> When I try to insert an Unicode "\u0000", there is an error $subject.
>
> postgres=# CREATE TABLE tbl (s varchar(10));
> CREATE TABLE
> postgres=# INSERT INTO tbl VALUES (E'\u0000');
> ERROR:  invalid Unicode escape value at or near "\u0000"
> LINE 1: INSERT INTO tbl VALUES (E'\u0000');
>                                   ^
>
> "\u0000" is valid unicode [1], why not we cannot insert it?

Yes, it is a valid codepoint, but unfortunately PostgreSQL can't
support it because it sometimes deals in null terminated string, even
though internally it does track string data and length separately.  We
have to do that to use libc facilities like strcoll_r(), and probably
many other things.



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Parallel vacuum workers prevent the oldest xmin from advancing
Следующее
От: vignesh C
Дата:
Сообщение: Re: Identify missing publications from publisher while create/alter subscription.