Parsed test spec with 3 sessions starting permutation: s1begin s1lock s2begin s2drop s1select s3getlocks s1commit s3getlocks s2commit step s1begin: BEGIN; step s1lock: LOCK TABLE part_drop_index_locking_subpart_child IN ACCESS SHARE MODE; step s2begin: BEGIN; step s2drop: DROP INDEX part_drop_index_locking_idx; step s1select: SELECT * FROM part_drop_index_locking_subpart_child; id -- (0 rows) step s3getlocks: SELECT s.query, c.relname, l.mode, l.granted FROM pg_locks l JOIN pg_class c ON l.relation = c.oid JOIN pg_stat_activity s ON l.pid = s.pid WHERE c.relname LIKE 'part_drop_index_locking%' ORDER BY s.query, c.relname, l.mode, l.granted; query |relname |mode |granted ----------------------------------------------------+---------------------------------------------+-------------------+------- DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking_idx |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking_subpart |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking_subpart_child |AccessExclusiveLock|f SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child |AccessShareLock |t SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx |AccessShareLock |t SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx1|AccessShareLock |t (7 rows) step s1commit: COMMIT; step s2drop: <... completed> step s3getlocks: SELECT s.query, c.relname, l.mode, l.granted FROM pg_locks l JOIN pg_class c ON l.relation = c.oid JOIN pg_stat_activity s ON l.pid = s.pid WHERE c.relname LIKE 'part_drop_index_locking%' ORDER BY s.query, c.relname, l.mode, l.granted; query |relname |mode |granted ---------------------------------------+--------------------------------------------+-------------------+------- DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_idx |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart_child |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart_child_id_idx|AccessExclusiveLock|t DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart_id_idx |AccessExclusiveLock|t (6 rows) step s2commit: COMMIT; starting permutation: s1begin s1lock s2begin s2dropsub s1select s3getlocks s1commit s3getlocks s2commit step s1begin: BEGIN; step s1lock: LOCK TABLE part_drop_index_locking_subpart_child IN ACCESS SHARE MODE; step s2begin: BEGIN; step s2dropsub: DROP INDEX part_drop_index_locking_subpart_idx; step s1select: SELECT * FROM part_drop_index_locking_subpart_child; id -- (0 rows) step s3getlocks: SELECT s.query, c.relname, l.mode, l.granted FROM pg_locks l JOIN pg_class c ON l.relation = c.oid JOIN pg_stat_activity s ON l.pid = s.pid WHERE c.relname LIKE 'part_drop_index_locking%' ORDER BY s.query, c.relname, l.mode, l.granted; query |relname |mode |granted ----------------------------------------------------+---------------------------------------------+-------------------+------- DROP INDEX part_drop_index_locking_subpart_idx; |part_drop_index_locking_subpart |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_subpart_idx; |part_drop_index_locking_subpart_child |AccessExclusiveLock|f DROP INDEX part_drop_index_locking_subpart_idx; |part_drop_index_locking_subpart_idx |AccessExclusiveLock|t SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child |AccessShareLock |t SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx |AccessShareLock |t SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx1|AccessShareLock |t (6 rows) step s1commit: COMMIT; step s2dropsub: <... completed> step s3getlocks: SELECT s.query, c.relname, l.mode, l.granted FROM pg_locks l JOIN pg_class c ON l.relation = c.oid JOIN pg_stat_activity s ON l.pid = s.pid WHERE c.relname LIKE 'part_drop_index_locking%' ORDER BY s.query, c.relname, l.mode, l.granted; query |relname |mode |granted -----------------------------------------------+---------------------------------------------+-------------------+------- DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart_child |AccessExclusiveLock|t DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart_child_id_idx1|AccessExclusiveLock|t DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart_idx |AccessExclusiveLock|t (4 rows) step s2commit: COMMIT;