From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Unify drop-by-OID functions
Date: Tue, 09 Jun 2020 07:46:34 +0000
Message-ID: <E1jiYxu-0005w1-TW@gemulon.postgresql.org> (raw)
Unify drop-by-OID functions
There are a number of Remove${Something}ById() functions that are
essentially identical in structure and only different in which catalog
they are working on. Refactor this to be one generic function. The
information about which oid column, index, etc. to use was already
available in ObjectProperty for most catalogs, in a few cases it was
easily added.
Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/331d9661-1743-857f-1cbb-d5728bcd62cb%402ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b1d32d3e3230f00b5baba08f75b4f665c7d6dac6
Modified Files
--------------
src/backend/catalog/aclchk.c | 33 -------
src/backend/catalog/dependency.c | 160 ++++++++++++++++-----------------
src/backend/catalog/objectaddress.c | 99 +++++++++++++++++++-
src/backend/catalog/pg_collation.c | 36 --------
src/backend/catalog/pg_conversion.c | 33 -------
src/backend/commands/amcmds.c | 27 ------
src/backend/commands/event_trigger.c | 22 -----
src/backend/commands/foreigncmds.c | 71 ---------------
src/backend/commands/functioncmds.c | 53 -----------
src/backend/commands/opclasscmds.c | 99 --------------------
src/backend/commands/proclang.c | 22 -----
src/backend/commands/publicationcmds.c | 23 -----
src/backend/commands/schemacmds.c | 23 -----
src/backend/commands/tsearchcmds.c | 71 ---------------
src/include/catalog/objectaddress.h | 1 +
src/include/catalog/pg_collation.h | 1 -
src/include/catalog/pg_conversion.h | 1 -
src/include/commands/defrem.h | 13 ---
src/include/commands/event_trigger.h | 1 -
src/include/commands/proclang.h | 1 -
src/include/commands/publicationcmds.h | 1 -
src/include/commands/schemacmds.h | 2 -
src/include/utils/acl.h | 1 -
23 files changed, 175 insertions(+), 619 deletions(-)
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: peter@eisentraut.org
Subject: Re: pgsql: Unify drop-by-OID functions
In-Reply-To: <E1jiYxu-0005w1-TW@gemulon.postgresql.org>
References: <E1jiYxu-0005w1-TW@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