Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group