Re: Mention invalid null byte sequence

From: Adrien CLERC <bugs-postgresql(at)antipoul(dot)fr>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Mention invalid null byte sequence
Date: 2020-12-07 09:57:47
Message-ID: db918f32-2182-b083-c7bb-8c20cb521168@antipoul.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Le 07/12/2020 à 10:02, Laurenz Albe a écrit :
> On Sat, 2020-12-05 at 21:58 +0000, PG Doc comments form wrote:
>> The following documentation comment has been logged on the website:
>>
>> Page: https://www.postgresql.org/docs/13/datatype-character.html
>> Description:
>>
>> I discovered accidentally that PostgreSQL doesn't accept null byte in text
>> type. It seems that Oracle does (see
>> https://www.postgresql.org/message-id/de752e01-f36c-821e-9181-cfba78c0fbc8%40propaas.com)
>> and SQLite does it too.
>>
>> So it should written in the character type that null byte are not accepted,
>> it would make like easier to migrate to PostgreSQL :)
> +1; how about the attached patch?

That would be a good start indeed.

I don't know the policy for documentation redundancy in PostgreSQL, but
it should be good to mention that also in
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE
since the basic "SELECT E'la\x00la';" will fail while "SELECT
E'la\x01la';" will not.

And, as a lazy person, I also would like to see it in the general
datatype page, since it's a common behavior.

Anyway, merging the first patch will enable the search for "NUL
character" to return a result, and that will be definitively a nice
improvement!

Have a nice day!

Adrien

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2020-12-07 20:27:22 Re: Mention invalid null byte sequence
Previous Message Laurenz Albe 2020-12-07 09:02:43 Re: Mention invalid null byte sequence