Thread: pgsql: Further consolidation of DROP statement handling.

pgsql: Further consolidation of DROP statement handling.

From
Robert Haas
Date:
Further consolidation of DROP statement handling.

This gets rid of an impressive amount of duplicative code, with only
minimal behavior changes.  DROP FOREIGN DATA WRAPPER now requires object
ownership rather than superuser privileges, matching the documentation
we already have.  We also eliminate the historical warning about dropping
a built-in function as unuseful.  All operations are now performed in the
same order for all object types handled by dropcmds.c.

KaiGai Kohei, with minor revisions by me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fc6d1006bda783cc002c61a5f072905849dbde4b

Modified Files
--------------
src/backend/commands/aggregatecmds.c       |   53 +--------
src/backend/commands/dropcmds.c            |  107 +++++++++++++++-
src/backend/commands/foreigncmds.c         |   83 ------------
src/backend/commands/functioncmds.c        |  111 ----------------
src/backend/commands/opclasscmds.c         |   98 --------------
src/backend/commands/operatorcmds.c        |   50 -------
src/backend/commands/proclang.c            |   37 ------
src/backend/commands/trigger.c             |   36 -----
src/backend/nodes/copyfuncs.c              |  128 +------------------
src/backend/nodes/equalfuncs.c             |  112 +----------------
src/backend/parser/gram.y                  |  170 ++++++++++++++-----------
src/backend/rewrite/rewriteRemove.c        |   65 ----------
src/backend/tcop/utility.c                 |  193 +++++-----------------------
src/include/commands/defrem.h              |    8 -
src/include/commands/proclang.h            |    1 -
src/include/commands/trigger.h             |    2 -
src/include/nodes/nodes.h                  |    8 -
src/include/nodes/parsenodes.h             |  103 +--------------
src/include/rewrite/rewriteRemove.h        |    3 -
src/test/regress/expected/foreign_data.out |   16 +--
src/test/regress/sql/foreign_data.sql      |    5 +-
21 files changed, 241 insertions(+), 1148 deletions(-)