From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Brennan Vincent <brennan@umanwizard.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Inaccurate documentation about identifiers
Date: Thu, 17 Nov 2022 15:01:10 -0500
Message-ID: <1954348.1668715270@sss.pgh.pa.us> (raw)
In-Reply-To: <efcd5fee059c8868ca47525a8cfdc8f42cf95fdc.camel@j-davis.com>
References: <feb15ca0-f449-c862-9414-66220e80304d@umanwizard.com>
<efcd5fee059c8868ca47525a8cfdc8f42cf95fdc.camel@j-davis.com>
Jeff Davis <pgsql@j-davis.com> writes:
> On Wed, 2022-11-16 at 08:36 -0500, Brennan Vincent wrote:
>> However, it seems that all non-ASCII characters are considered
>> "letters"
> You're correct: it seems to allow any byte with the high bit set;
> including, for example, a zero-width space.
Yes, see scan.l:
ident_start [A-Za-z\200-\377_]
ident_cont [A-Za-z\200-\377_0-9\$]
identifier {ident_start}{ident_cont}*
> I don't think we want to change the documentation here, because that
> would amount to a promise that we support such identifiers forever.
> I also don't think we want to change the code, because it opens up
> several problems and I'm not sure it's worth trying to solve them.
Right. IIRC, the SQL spec would have us allow only things that actually
are letters per Unicode or other relevant spec, but (1) that's rather
encoding-dependent and (2) the hit to parsing speed would likely be
non-negligible. Still, we might do it someday if someone can find
a way around those concerns. (Accepting whitespace, in particular,
is Not Great.) I think benign neglect in the docs is the best path.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, brennan@umanwizard.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Inaccurate documentation about identifiers
In-Reply-To: <1954348.1668715270@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox