Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-07 Thread David G. Johnston
On Fri, Oct 7, 2022 at 5:16 PM Bryn Llewellyn wrote: > david.g.johns...@gmail.com wrote: > > b...@yugabyte.com wrote: > > (3) The PG doc on quote_ident says this in large friendly letters: > > Quotes are added only if necessary… > > > Notice "only". I now know that this is very much not the

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-07 Thread Christophe Pettus
> On Oct 7, 2022, at 17:16, Bryn Llewellyn wrote: > What does "make for a good bug report" mean, David? Well, first of all, brevity. :-) > Is it: > > (1.1) You, David, or somebody else who has been officially recognized as a PG > Contributor

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-07 Thread Adrian Klaver
On 10/7/22 17:16, Bryn Llewellyn wrote: david.g.johns...@gmail.com wrote: b...@yugabyte.com  wrote: (3) The PG doc on quote_ident says this in large friendly letters: Quotes are added only if necessary… Notice "only". I now

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-07 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> (3) The PG doc on quote_ident says this in large friendly letters: >> >>> Quotes are added only if necessary… >> >> Notice "only". I now know that this is very much not the case. You can >> compose an effectively

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-06 Thread David G. Johnston
On Thu, Oct 6, 2022 at 3:53 PM Bryn Llewellyn wrote: > > (3) The PG doc on quote_ident says this in large friendly letters: > > Quotes are added only if necessary… > > > Notice "only". I now know that this is very much not the case. You can > compose an effectively unlimited number of different

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-06 Thread Bryn Llewellyn
> list.pg.ga...@pendari.org wrote: > >> b...@yugabyte.com wrote: >> >> Does this imply a risk that a future PG version will go against the SQL >> standard and reject any non-latin name that is free of all punctuation >> characters, when used in the role of a SQL identifier, unless it's double

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-06 Thread Bryn Llewellyn
> karsten.hilb...@gmx.net wrote: > >> b...@yugabyte.com wrote: >> >> What we deal with in our ordinary professional work is SQL texts, program >> source texts, within these, SQL identifier texts, and then the conventional >> display of the results of SQL and program execution. To emphasize the

Aw: Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-06 Thread Karsten Hilbert
What we deal with in our ordinary professional work is SQL texts, program source texts, within these, SQL identifier texts, and then the conventional display of the results of SQL and program execution. To emphasize the point about resulst display, try "\d s.*" in "\t off" mode. You'll see

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-06 Thread Gavan Schneider
On 6 Oct 2022, at 16:04, Bryn Llewellyn wrote: Does this imply a risk that a future PG version will go against the SQL standard and reject any non-latin name that is free of all punctuation characters, when used in the role of a SQL identifier, unless it's double quoted? From my perspective

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Bryn Llewellyn
> x...@thebuild.com wrote: > > There is no first-class "identifier" type in PostgreSQL, so a function can't > "return an identifier." It returns a string which might, when placed into a > larger string and processed as SQL, be lexically correct as an identifier. It takes huge discipline

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Bryn Llewellyn
> adrian.kla...@aklaver.com wrote: > > The way I see is if it where an actual identifier then this: > > select * from quote_ident('$dog'); > > quote_ident > - > "$dog" > > would be equal to this: > > select * from "$dog"; I think that the clue here is to go into philosophical

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> david.g.johns...@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

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Christophe Pettus
> On Oct 5, 2022, at 17:16, Bryn Llewellyn wrote: > B.t.w, the value of "quote_ident()" rests on the distinction between a name > (what you provide with the function's actual argument) and an identifier > (what it returns). There is no first-class "identifier" type in PostgreSQL, so a

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Adrian Klaver
On 10/5/22 17:16, Bryn Llewellyn wrote: The doc for "quote_ident()" says this: « https://www.postgresql.org/docs/14/functions-string.html Returns the given string suitably quoted to be used as an identifier in an SQL statement string. Quotes are added only if necessary (i.e., if the string

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Tom Lane
"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

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread David G. Johnston
On Wed, Oct 5, 2022 at 5:17 PM Bryn Llewellyn wrote: > The doc for "quote_ident()" says this: > > « > https://www.postgresql.org/docs/14/functions-string.html > Returns the given string suitably quoted to be used as an identifier in an > SQL statement string. Quotes are added only if necessary

('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Bryn Llewellyn
The doc for "quote_ident()" says this: « https://www.postgresql.org/docs/14/functions-string.html Returns the given string suitably quoted to be used as an identifier in an SQL statement string. Quotes are added only if necessary (i.e., if the string contains non-identifier characters or would