> On Oct 5, 2022, at 17:16, Bryn Llewellyn <bryn@yugabyte.com> wrote:
> B.t.w, the value of "quote_ident()" rests on the distinction between a name (what you provide with the function's
actualargument) and an identifier (what it returns).
There is no first-class "identifier" type in PostgreSQL, so a function can't "return an identifier." It returns a
stringwhich might, when placed into a larger string and processed as SQL, be lexically correct as an identifier.
To be useful, quote_ident() can't fail to quote a string in such a way that it's not a valid identifier to PostgreSQL.
Ifit quotes some strings that PostgreSQL would accept as identifiers without quotes, that's interesting, I guess, but
I'mnot sure I see how it is a bug.
Pragmatically, what this function is for it to assemble SQL statements as strings. Any review of its correctness needs
tobe based on a situation where it can't be used for that.