mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +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,13 +8,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_namespace.c,v 1.14 2005/06/28 05:08:52 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_namespace.c,v 1.15 2005/07/07 20:39:57 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include "access/heapam.h"
|
||||
#include "catalog/dependency.h"
|
||||
#include "catalog/indexing.h"
|
||||
#include "catalog/pg_namespace.h"
|
||||
#include "utils/builtins.h"
|
||||
@@ -72,5 +73,8 @@ NamespaceCreate(const char *nspName, Oid ownerId)
|
||||
|
||||
heap_close(nspdesc, RowExclusiveLock);
|
||||
|
||||
/* Record dependency on owner */
|
||||
recordDependencyOnOwner(NamespaceRelationId, nspoid, ownerId);
|
||||
|
||||
return nspoid;
|
||||
}
|
||||
|
Reference in New Issue
Block a user