mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Track dependencies on shared objects (which is to say, roles; we already
have adequate mechanisms for tracking the contents of databases and tablespaces). This solves the longstanding problem that you can drop a user who still owns objects and/or has access permissions. Alvaro Herrera, with some kibitzing from Tom Lane.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.285 2005/06/05 00:38:07 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.286 2005/07/07 20:39:57 tgl Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -755,6 +755,8 @@ heap_create_with_catalog(const char *relname,
|
||||
* make a dependency link to force the relation to be deleted if its
|
||||
* namespace is. Skip this in bootstrap mode, since we don't make
|
||||
* dependencies while bootstrapping.
|
||||
*
|
||||
* Also make a dependency link to its owner.
|
||||
*/
|
||||
if (!IsBootstrapProcessingMode())
|
||||
{
|
||||
@@ -768,6 +770,8 @@ heap_create_with_catalog(const char *relname,
|
||||
referenced.objectId = relnamespace;
|
||||
referenced.objectSubId = 0;
|
||||
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
|
||||
|
||||
recordDependencyOnOwner(RelationRelationId, new_rel_oid, GetUserId());
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user