From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE
Date: Wed, 05 Oct 2022 21:20:26 -0400
Message-ID: <2583527.1665019226@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwbJhEdos8S4ea0hJXfAToGL1y8qFsOeCPzZzu+NkixcXA@mail.gmail.com>
References: <CA4667FA-A71E-4ECD-B9EE-4A2F8929CB22@yugabyte.com>
<CAKFQuwbJhEdos8S4ea0hJXfAToGL1y8qFsOeCPzZzu+NkixcXA@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, bryn@yugabyte.com
Subject: Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE
In-Reply-To: <2583527.1665019226@sss.pgh.pa.us>
References: <CA4667FA-A71E-4ECD-B9EE-4A2F8929CB22@yugabyte.com> <CAKFQuwbJhEdos8S4ea0hJXfAToGL1y8qFsOeCPzZzu+NkixcXA@mail.gmail.com> <2583527.1665019226@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