Invalid Unicode escape value at or near "\u0000"

From: Japin Li <japinli(at)hotmail(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Invalid Unicode escape value at or near "\u0000"
Date: 2021-11-13 03:31:57
Message-ID: MEYP282MB16690E768008E758D270C631B6969@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi, hackers

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?

[1] https://www.unicode.org/charts/PDF/U0000.pdf

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2021-11-13 04:15:11 Re: Allow users to choose what happens when recovery target is not reached
Previous Message Japin Li 2021-11-13 03:04:12 Inconsistent error message for varchar(n)