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:12 -0300
commit412a4295b5390cfe4fd5b9fc84a25c6e2d1aa0ad (patch)
treec6a365a2e3daab18d6de4558caf0446ceb8185c2 /src
parent6c00b2bbf7726efdf7d96ad5c9e9ef0450d2a150 (diff)
downloadpostgresql-412a4295b5390cfe4fd5b9fc84a25c6e2d1aa0ad.tar.gz
postgresql-412a4295b5390cfe4fd5b9fc84a25c6e2d1aa0ad.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 77e0d08f9b4..8d2d37c730a 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)