aboutsummaryrefslogtreecommitdiff
path: root/src/backend/catalog/index.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/catalog/index.c')
-rw-r--r--src/backend/catalog/index.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index fc6caaacef1..bb90fd38113 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2018,6 +2018,15 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
LOCKMODE lockmode;
/*
+ * A temporary relation uses a non-concurrent DROP. Other backends can't
+ * access a temporary relation, so there's no harm in grabbing a stronger
+ * lock (see comments in RemoveRelations), and a non-concurrent DROP is
+ * more efficient.
+ */
+ Assert(get_rel_persistence(indexId) != RELPERSISTENCE_TEMP ||
+ (!concurrent && !concurrent_lock_mode));
+
+ /*
* To drop an index safely, we must grab exclusive lock on its parent
* table. Exclusive lock on the index alone is insufficient because
* another backend might be about to execute a query on the parent table.