summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorTom Lane2005-07-07 20:40:02 +0000
committerTom Lane2005-07-07 20:40:02 +0000
commit59d1b3d99e690734fa2a2bd0fae12b0cb1084294 (patch)
treeff074126ccc1a6342de38737d79e218f22fb9be4 /src/bin
parent442b59dd8bc4b0efa1d733690f6ba9dae3f61b1f (diff)
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.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/initdb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index b61c56d7218..f5ea903ca34 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -42,7 +42,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.90 2005/07/02 17:01:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.91 2005/07/07 20:39:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1512,6 +1512,10 @@ setup_depend(void)
* must be the only entries for their objects.
*/
"DELETE FROM pg_depend;\n",
+ "VACUUM pg_depend;\n",
+ "DELETE FROM pg_shdepend;\n",
+ "VACUUM pg_shdepend;\n",
+
"INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
" FROM pg_class;\n",
"INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
@@ -1541,10 +1545,13 @@ setup_depend(void)
"INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
" FROM pg_namespace "
" WHERE nspname LIKE 'pg%';\n",
+
+ "INSERT INTO pg_shdepend SELECT 0, 0, 0, tableoid, oid, 'p' "
+ " FROM pg_authid;\n",
NULL
};
- fputs(_("initializing pg_depend ... "), stdout);
+ fputs(_("initializing dependencies ... "), stdout);
fflush(stdout);
snprintf(cmd, sizeof(cmd),