aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 5a73b48ea76..55637175356 100644
--- a/src/backend/catalog/pg_shdepend.c
+++ b/src/backend/catalog/pg_shdepend.c
@@ -1217,8 +1217,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)