Обсуждение: Support for U+0000 text

Поиск
Список
Период
Сортировка

Support for U+0000 text

От
Paul Draper
Дата:
When inserting the U+0000 (NULL) character, PostgreSQL errors:

ERROR: invalid byte sequence for encoding "UTF8": 0x00

I understand I could not use the text type, but given that this is a valid Unicode character, is there a reason this is not supported?

Re: Support for U+0000 text

От
Tom Lane
Дата:
Paul Draper <paulddraper@gmail.com> writes:
> When inserting the U+0000 (NULL) character, PostgreSQL errors:
> ERROR: invalid byte sequence for encoding "UTF8": 0x00

> I understand I could not use the text type, but given that this is a valid
> Unicode character, is there a reason this is not supported?

Yes: internally, the text representation of all data types is a C string,
ie a \0-terminated string.  That's not something that's practical to
change.

            regards, tom lane


Re: Support for U+0000 text

От
Shreeyansh Dba
Дата:
Hi Paul,

Go through below link hope this will help you.

Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com


On Thu, Mar 7, 2019 at 8:36 AM Paul Draper <paulddraper@gmail.com> wrote:
When inserting the U+0000 (NULL) character, PostgreSQL errors:

ERROR: invalid byte sequence for encoding "UTF8": 0x00

I understand I could not use the text type, but given that this is a valid Unicode character, is there a reason this is not supported?