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 <[email protected]>
Reviewed-by: Robert Haas <[email protected]>
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 via email to