diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2005-11-21 12:49:33 +0000 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2005-11-21 12:49:33 +0000 |
| commit | cec3b0a9e63fd94b05dac894cca8bfa51358afec (patch) | |
| tree | 464377c39a1b3f42b4d2ab82a261e9a603fa1220 /src/include/catalog | |
| parent | c52795d18a698d25b9cd7cd1ca9318a42b08fdb9 (diff) | |
| download | postgresql-cec3b0a9e63fd94b05dac894cca8bfa51358afec.tar.gz | |
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.
Diffstat (limited to 'src/include/catalog')
| -rw-r--r-- | src/include/catalog/dependency.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h index 5c5e87c746..c91406390b 100644 --- a/src/include/catalog/dependency.h +++ b/src/include/catalog/dependency.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.17 2005/10/15 02:49:42 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.18 2005/11/21 12:49:32 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -177,6 +177,8 @@ extern long changeDependencyFor(Oid classId, Oid objectId, Oid refClassId, Oid oldRefObjectId, Oid newRefObjectId); +extern bool objectIsInternalDependency(Oid classId, Oid objectId); + /* in pg_shdepend.c */ extern void recordSharedDependencyOn(ObjectAddress *depender, @@ -201,4 +203,8 @@ extern void copyTemplateDependencies(Oid templateDbId, Oid newDbId); extern void dropDatabaseDependencies(Oid databaseId); +extern void shdepDropOwned(List *relids, DropBehavior behavior); + +extern void shdepReassignOwned(List *relids, Oid newrole); + #endif /* DEPENDENCY_H */ |
