aboutsummaryrefslogtreecommitdiff
path: root/src/backend/catalog/heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/catalog/heap.c')
-rw-r--r--src/backend/catalog/heap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 2cf210d82c2..bfffd6ef4c7 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1603,14 +1603,10 @@ heap_drop_with_catalog(Oid relid)
/*
* There can no longer be anyone *else* touching the relation, but we
- * might still have open queries or cursors in our own session.
+ * might still have open queries or cursors, or pending trigger events,
+ * in our own session.
*/
- if (rel->rd_refcnt != 1)
- ereport(ERROR,
- (errcode(ERRCODE_OBJECT_IN_USE),
- errmsg("cannot drop \"%s\" because "
- "it is being used by active queries in this session",
- RelationGetRelationName(rel))));
+ CheckTableNotInUse(rel, "DROP TABLE");
/*
* Delete pg_foreign_table tuple first.