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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 72a97b8b7a2..dd63c7e1296 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1237,6 +1237,13 @@ heap_drop_with_catalog(Oid relid)
rel = relation_open(relid, AccessExclusiveLock);
/*
+ * There can no longer be anyone *else* touching the relation, but we
+ * might still have open queries or cursors, or pending trigger events,
+ * in our own session.
+ */
+ CheckTableNotInUse(rel, "DROP TABLE");
+
+ /*
* Schedule unlinking of the relation's physical file at commit.
*/
if (rel->rd_rel->relkind != RELKIND_VIEW &&