Re: extended stats objects are the only thing written like "%s"."%s"
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Justin Pryzby <pryzby@telsasoft.com>,
Tomas Vondra <tomas.vondra@enterprisedb.com>,
Dean Rasheed <dean.a.rasheed@gmail.com>, pgsql-hackers@postgresql.org,
Peter Eisentraut <peter@eisentraut.org>
Date: 2021-08-28T19:48:21Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes: > I think using "%s.%s" as is done everywhere else is pretty much > pointless. It's not usable as an object identifier, since you have to > make sure to remove the existing quotes, and unless the names work > without quotes, you have to add different quotes. So it looks «nice» > but it's functionally more work. I think what we are doing there is following the message style guideline that says to put double quotes around inserted strings. In this case schema.object (as a whole) is the inserted string. People often confuse this with SQL double-quoted identifiers, but it has nothing whatsoever to do with SQL's rules. (It's easier to make sense of this rule in translations where the quote marks are not ASCII double-quotes ... like your example with «nice».) In short: Justin is right, this should not be done this way. regards, tom lane
Commits
-
psql: Fix name quoting on extended statistics
- ce6b662aae7a 14.0 landed
- a397109114c8 15.0 landed
-
Extended statistics on expressions
- a4d75c86bf15 14.0 cited
-
Change CREATE STATISTICS syntax
- bc085205c8a4 10.0 cited