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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alex Hunsaker" <badalex(at)gmail(dot)com>
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-14 18:11:32
Message-ID: 16821.1213467092@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Alex Hunsaker" <badalex(at)gmail(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2008-06-14 18:21:54 Re: Tentative patch for making DROP put dependency info in DETAIL
Previous Message Bruce Momjian 2008-06-14 00:15:59 Re: Simplify formatting.c