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

From: "Alex Hunsaker" <badalex(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Tentative patch for making DROP put dependency info in DETAIL
Date: 2008-06-13 04:54:27
Message-ID: 34d269d40806122154t687e49ddy1c3727d269cec610@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Thu, Jun 12, 2008 at 5:35 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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(-)

Attachment Content-Type Size
refactor_dropstmt.patch.gz application/x-gzip 10.1 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message pgsql 2008-06-13 13:35:19 SSL configure patch
Previous Message Euler Taveira de Oliveira 2008-06-13 04:49:24 small typo in DTrace docs