Re: Tentative patch for making DROP put dependency info in DETAIL - Mailing list pgsql-patches

From Tom Lane
Subject Re: Tentative patch for making DROP put dependency info in DETAIL
Date
Msg-id 16821.1213467092@sss.pgh.pa.us
Whole thread Raw
In response to Re: Tentative patch for making DROP put dependency info in DETAIL  ("Alex Hunsaker" <badalex@gmail.com>)
Responses Re: Tentative patch for making DROP put dependency info in DETAIL
List pgsql-patches
"Alex Hunsaker" <badalex@gmail.com> writes:
> 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

Applied with revisions.  I had suggested moving stuff into aclchk.c on
the assumption that it needed to be called from more than one place.
But after you got rid of the separate RemoveIndex and RemoveView
functions (which was a good idea), there was only one call site for
those functions, so I just folded them into tablecmds.c; and in fact
integrated CheckDropPermissions right into RemoveRelations so it looked
more like all the other DropStmt functions.  Also,
RemoveTypes/RemoveDomains might as well be integrated completely since
we're doing relations that way.  I also chose to clean up the conversion
dropping stuff, since there didn't seem to be any point in the
separation between ConversionDrop and DropConversionCommand.

The only actual bug I found was that you'd used "break" where you should
have used "continue" for a non-existent object in each routine, so a
multi-object DROP IF NOT EXISTS would fail to perform as expected.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Simplify formatting.c
Next
From: Andrew Dunstan
Date:
Subject: Re: Tentative patch for making DROP put dependency info in DETAIL