Re: [PGdocs] fix description for handling pf non-ASCII characters - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PGdocs] fix description for handling pf non-ASCII characters
Date
Msg-id 803569.1695863971@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PGdocs] fix description for handling pf non-ASCII characters  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: [PGdocs] fix description for handling pf non-ASCII characters
RE: [PGdocs] fix description for handling pf non-ASCII characters
List pgsql-hackers
Peter Smith <smithpb2250@gmail.com> writes:
> I had in mind something like a SHIFT-JIS encoding where a single
> "character" may include some trail bytes that happen to be in the
> ASCII printable range. AFAIK because the new logic is processing
> bytes, not characters, I thought the end result could be a mix of
> escaped and unescaped bytes for the single SJIS character.

It will not, because ...

> But now looking at PostgreSQL-supported character sets [1] I saw SJIS
> is not supported anyhow. Unfortunately, I am not familiar enough with
> other encodings to know if there is still a chance of similar
> printable ASCII trail bytes so I am fine with whatever wording is
> chosen.

... trailing bytes that could be mistaken for ASCII are precisely
the property that causes us to reject an encoding as not backend-safe.
So this code doesn't need to consider that hazard, and processing the
string byte-by-byte is perfectly OK.

I'd be inclined to keep the text as simple as possible and not focus on
the distinction between bytes and characters.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: [PGdocs] fix description for handling pf non-ASCII characters
Next
From: Peter Geoghegan
Date:
Subject: Re: Eager page freeze criteria clarification