pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid casting away const in sepgsql's quote_object_name.
Date: Sat, 27 Aug 2022 16:52:59 +0000
Message-ID: <E1oRz3K-000A9t-MP@gemulon.postgresql.org> (raw)

Avoid casting away const in sepgsql's quote_object_name.

quote_identifier's API is designed on the assumption that it's
not worth worrying about a short-term memory leak when we have
to produce a quoted version of the given identifier.  Whoever wrote
quote_object_name took it on themselves to override that judgment,
but the only way to do so is to cast away const someplace.  We can
avoid that and substantially shorten the function by going along
with quote_identifier's opinion.  AFAICS quote_object_name is not
used in any way where this would be unsustainable.

Per discussion of commit 45987aae2, which exposed that we had
a casting-away-const situation here.

Discussion: https://postgr.es/m/20220827112304.GL2342@telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/94077df1c2def788f888a27ed0035236f806466d

Modified Files
--------------
contrib/sepgsql/label.c | 33 ++++++---------------------------
1 file changed, 6 insertions(+), 27 deletions(-)



Message-ID: <E1oRz3K-000A9t-MP@gemulon.postgresql.org>
Permalink:  ../E1oRz3K-000A9t-MP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oRz3K-000A9t-MP@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Avoid casting away const in sepgsql's quote_object_name.
  In-Reply-To: <E1oRz3K-000A9t-MP@gemulon.postgresql.org>
  References: <E1oRz3K-000A9t-MP@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox