Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE - Mailing list pgsql-general

From Tom Lane
Subject Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE
Date
Msg-id 2583527.1665019226@sss.pgh.pa.us
Whole thread Raw
In response to Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE
List pgsql-general
"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



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE
Next
From: Adrian Klaver
Date:
Subject: Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE