Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovl4W-00006t-Jv for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Nov 2022 20:01:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovl4V-0002mD-G3 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Nov 2022 20:01:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovl4V-0002lw-8C for pgsql-bugs@lists.postgresql.org; Thu, 17 Nov 2022 20:01:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovl4S-0004eG-T2 for pgsql-bugs@lists.postgresql.org; Thu, 17 Nov 2022 20:01:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2AHK1ADg1954349; Thu, 17 Nov 2022 15:01:10 -0500 From: Tom Lane To: Jeff Davis cc: Brennan Vincent , pgsql-bugs@lists.postgresql.org Subject: Re: Inaccurate documentation about identifiers In-reply-to: References: Comments: In-reply-to Jeff Davis message dated "Thu, 17 Nov 2022 11:12:39 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1954347.1668715270.1@sss.pgh.pa.us> Date: Thu, 17 Nov 2022 15:01:10 -0500 Message-ID: <1954348.1668715270@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis 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