Re: extended stats objects are the only thing written like "%s"."%s"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: extended stats objects are the only thing written like "%s"."%s"
Date: 2021-08-28 19:48:21
Message-ID: 1050792.1630180101@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-08-28 19:57:51 Re: pg_receivewal: remove extra conn = NULL; in StreamLog
Previous Message Alvaro Herrera 2021-08-28 18:25:21 Re: extended stats objects are the only thing written like "%s"."%s"