From: Tom Lane <tgl@sss.pgh.pa.us>
To: bryn@yugabyte.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17635: The behavior of quote_ident differs from what the doc specifies
Date: Tue, 11 Oct 2022 15:51:33 -0400
Message-ID: <489744.1665517893@sss.pgh.pa.us> (raw)
In-Reply-To: <17635-bd4f9739f88ec6a9@postgresql.org>
References: <17635-bd4f9739f88ec6a9@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> The quote_ident doc here:
> https://www.postgresql.org/docs/11/functions-string.html#FUNCTIONS-STRING-OTHER> says this:
> «
> Return the given string suitably quoted to be used as an identifier in an
> SQL statement string. Quotes are added only if necessary...
> »
> But tests show that the returned text is often double-quoted when this is
> NOT necessary.
As I said on the other thread, I think it's good from a future-proofing
standpoint that quote_ident is more conservative than strictly necessary.
One of the primary use-cases for it is preparing dumps that might get
loaded into future PG versions, or other RDBMSes altogether, that could
have different ideas of which characters are allowed in unquoted
identifiers. (Most obviously, we might stop lumping all non-ASCII
characters together.)
So I don't want to change the code. Perhaps we should remove "only"
from the quoted docs fragment, though.
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, bryn@yugabyte.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17635: The behavior of quote_ident differs from what the doc specifies
In-Reply-To: <489744.1665517893@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