Implement DROP OWNED and REASSIGN OWNED. These new commands facilitate the

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: cec3b0a9e63fd94b05dac894cca8bfa51358afec
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2005-11-21T12:49:33Z
Releases: 8.2.0
Implement DROP OWNED and REASSIGN OWNED.  These new commands facilitate the
process of dropping roles by dropping objects owned by them and privileges
granted to them, or giving the owned objects to someone else, through the
use of the data stored in the new pg_shdepend catalog.

Some refactoring of the GRANT/REVOKE code was needed, as well as ALTER OWNER
code.  Further cleanup of code duplication in the GRANT code seems necessary.

Implemented by me after an idea from Tom Lane, who also provided various kind
of implementation advice.

Regression tests pass.  Some tests for the new functionality are also added,
as well as rudimentary documentation.

Files

PathChange+/−
doc/src/sgml/ref/allfiles.sgml modified +3 −1
doc/src/sgml/ref/drop_owned.sgml added +99 −0
doc/src/sgml/reference.sgml modified +3 −1
doc/src/sgml/ref/reassign_owned.sgml added +89 −0
src/backend/catalog/aclchk.c modified +458 −300
src/backend/catalog/pg_depend.c modified +53 −1
src/backend/catalog/pg_shdepend.c modified +262 −1
src/backend/commands/conversioncmds.c modified +41 −7
src/backend/commands/functioncmds.c modified +47 −10
src/backend/commands/opclasscmds.c modified +60 −17
src/backend/commands/operatorcmds.c modified +30 −7
src/backend/commands/schemacmds.c modified +42 −5
src/backend/commands/tablecmds.c modified +2 −3
src/backend/commands/typecmds.c modified +3 −2
src/backend/commands/user.c modified +62 −1
src/backend/nodes/copyfuncs.c modified +28 −1
src/backend/nodes/equalfuncs.c modified +24 −4
src/backend/parser/gram.y modified +35 −3
src/backend/parser/keywords.c modified +3 −1
src/backend/tcop/utility.c modified +20 −3
src/include/catalog/dependency.h modified +7 −1
src/include/commands/conversioncmds.h modified +2 −1
src/include/commands/defrem.h modified +4 −1
src/include/commands/schemacmds.h modified +2 −1
src/include/commands/tablecmds.h modified +3 −1
src/include/commands/user.h modified +3 −1
src/include/nodes/nodes.h modified +3 −1
src/include/nodes/parsenodes.h modified +21 −1
src/include/utils/acl.h modified +4 −1
src/test/regress/expected/dependency.out modified +70 −0
src/test/regress/sql/dependency.sql modified +49 −0