aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2012-10-03 12:22:41 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2012-10-03 12:29:38 -0300
commitda24920ab8ea6b22632103845c3c6126c8833ca6 (patch)
treeb80268b552eca9cbd5e551c2a5a1f02b2882b269 /src
parent03dfbce9a2d5f1680438ddb2837b68e6a6624b66 (diff)
downloadpostgresql-da24920ab8ea6b22632103845c3c6126c8833ca6.tar.gz
postgresql-da24920ab8ea6b22632103845c3c6126c8833ca6.zip
REASSIGN OWNED: consider grants on tablespaces, too
Apparently this was considered in the original code (see commit cec3b0a9) but I failed to notice that such entries would always be skipped by the database check at the start of the loop. Per bugs #7578 by Nikolay, #6116 by tushar.qa@gmail.com.
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/pg_shdepend.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c
index a2bb9f58a2d..1ecf12c211d 100644
--- a/src/backend/catalog/pg_shdepend.c
+++ b/src/backend/catalog/pg_shdepend.c
@@ -1214,8 +1214,12 @@ shdepDropOwned(List *roleids, DropBehavior behavior)
Form_pg_shdepend sdepForm = (Form_pg_shdepend) GETSTRUCT(tuple);
ObjectAddress obj;
- /* We only operate on objects in the current database */
- if (sdepForm->dbid != MyDatabaseId)
+ /*
+ * We only operate on shared objects and objects in the current
+ * database
+ */
+ if (sdepForm->dbid != MyDatabaseId &&
+ sdepForm->dbid != InvalidOid)
continue;
switch (sdepForm->deptype)