File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1446,9 +1446,11 @@ index_drop(Oid indexId, bool concurrent)
14461446
14471447 /*
14481448 * Now we must wait until no running transaction could be using the
1449- * index for a query. Note we do not need to worry about xacts that
1450- * open the table for reading after this point; they will see the
1451- * index as invalid when they open the relation.
1449+ * index for a query. Use AccessExclusiveLock here to check for
1450+ * running transactions that hold locks of any kind on the table.
1451+ * Note we do not need to worry about xacts that open the table for
1452+ * reading after this point; they will see the index as invalid when
1453+ * they open the relation.
14521454 *
14531455 * Note: the reason we use actual lock acquisition here, rather than
14541456 * just checking the ProcArray and sleeping, is that deadlock is
Original file line number Diff line number Diff line change @@ -651,9 +651,10 @@ DefineIndex(IndexStmt *stmt,
651651 * for an overview of how this works)
652652 *
653653 * Now we must wait until no running transaction could have the table open
654- * with the old list of indexes. Note we do not need to worry about xacts
655- * that open the table for writing after this point; they will see the new
656- * index when they open it.
654+ * with the old list of indexes. Use ShareLock to consider running
655+ * transactions that hold locks that permit writing to the table. Note we
656+ * do not need to worry about xacts that open the table for writing after
657+ * this point; they will see the new index when they open it.
657658 *
658659 * Note: the reason we use actual lock acquisition here, rather than just
659660 * checking the ProcArray and sleeping, is that deadlock is possible if
You can’t perform that action at this time.
0 commit comments