Thursday, June 12, 2008

Re: [PATCHES] Tentative patch for making DROP put dependency info in DETAIL

On Thu, Jun 12, 2008 at 5:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> So that's leading me to lean towards keeping RemoveRelation
> et al where they are and distributing the work currently done in
> ProcessUtility out to them. This sounds duplicative, but about all that
> really is there to duplicate is a foreach loop, which you're going to
> need anyway if the routines are to handle multiple objects.

Ok Here it is:
-Moves CheckDropPermissions and friends from utility.c to aclchk.c
(pg_drop_permission_check)

-Makes all the Remove* functions take a DropStmt *, they each do their
own foreach() loop and permission checks

-removed RemoveView and RemoveIndex because they were exactly the same
as RemoveRelation

-added an "s" to the end of the Remove* functions to denote they may
remove more than one (i.e. RemoveRelations)

-consolidated RemoveType and RemoveDomain into a common function
(static void removeHelper())

-made performMultipleDeletions when we only have one item we are
deleting log the same way (with the object name)

src/backend/catalog/aclchk.c | 154 +++++++++++++++
src/backend/catalog/dependency.c | 9 +-
src/backend/catalog/pg_conversion.c | 54 ++++---
src/backend/commands/conversioncmds.c | 45 +++--
src/backend/commands/indexcmds.c | 27 ---
src/backend/commands/schemacmds.c | 91 +++++----
src/backend/commands/tablecmds.c | 66 ++++++-
src/backend/commands/tsearchcmds.c | 290 +++++++++++++++++------------
src/backend/commands/typecmds.c | 189 ++++++++-----------
src/backend/commands/view.c | 23 ---
src/backend/tcop/utility.c | 288 +++++------------------------
src/include/catalog/pg_conversion_fn.h | 2 +-
src/include/commands/conversioncmds.h | 3 +-
src/include/commands/defrem.h | 14 +-
src/include/commands/schemacmds.h | 2 +-
src/include/commands/tablecmds.h | 2 +-
src/include/commands/typecmds.h | 4 +-
src/include/commands/view.h | 2 +-
src/include/utils/acl.h | 1 +
src/test/regress/expected/foreign_key.out | 11 -
src/test/regress/expected/truncate.out | 6 -
21 files changed, 645 insertions(+), 638 deletions(-)

No comments: