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 1ogFYu-0003FB-Cd for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 01:20:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ogFYt-0003P9-4m for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 01:20:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogFYs-0003NS-QM for pgsql-general@lists.postgresql.org; Thu, 06 Oct 2022 01:20:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogFYq-0005P1-F3 for pgsql-general@lists.postgresql.org; Thu, 06 Oct 2022 01:20:29 +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 2961KQCs2583528; Wed, 5 Oct 2022 21:20:26 -0400 From: Tom Lane To: "David G. Johnston" cc: Bryn Llewellyn , pgsql-general list Subject: Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 05 Oct 2022 17:31:48 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2583526.1665019226.1@sss.pgh.pa.us> Date: Wed, 05 Oct 2022 21:20:26 -0400 Message-ID: <2583527.1665019226@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > So I can see an argument for the existing behavior. It doesn't seem worth > changing in any case. And I don't really see the documentation being > improved by covering this corner case in detail when the current behavior > is at least intuitive. quote_ident is a good bit more conservative than the core lexer about what is an "identifier character" --- it considers all non-ASCII characters as requiring quoting, too. For typical uses of quote_ident, I think this is good future-proofing: it makes it very much less likely that something quote_ident decides not to quote would be rejected by some future PG version (not to mention non-PG SQL databases). So I'm not really in a hurry to change the code. Maybe we should tweak the docs a bit. regards, tom lane