Re: Support for U+0000 text

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Draper <paulddraper(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Support for U+0000 text
Date: 2019-03-07 03:40:31
Message-ID: 21019.1551930031@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Paul Draper <paulddraper(at)gmail(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Shreeyansh Dba 2019-03-07 03:59:46 Re: Support for U+0000 text
Previous Message Paul Draper 2019-03-07 03:06:10 Support for U+0000 text