Skip to content

Commit bec6e6c

Browse files
committed
REASSIGN OWNED: consider grants on tablespaces, too
Apparently this was considered in the original code (see commit cec3b0a) 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.
1 parent 3e291ca commit bec6e6c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/catalog/pg_shdepend.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,8 +1210,12 @@ shdepDropOwned(List *roleids, DropBehavior behavior)
12101210
Form_pg_shdepend sdepForm = (Form_pg_shdepend) GETSTRUCT(tuple);
12111211
ObjectAddress obj;
12121212

1213-
/* We only operate on objects in the current database */
1214-
if (sdepForm->dbid != MyDatabaseId)
1213+
/*
1214+
* We only operate on shared objects and objects in the current
1215+
* database
1216+
*/
1217+
if (sdepForm->dbid != MyDatabaseId &&
1218+
sdepForm->dbid != InvalidOid)
12151219
continue;
12161220

12171221
switch (sdepForm->deptype)

0 commit comments

Comments
 (0)