Hi,
I'm curious to understand when table-level locks are released by one transaction to use in another.
For instance, say I have the following transaction, where index1 and index2 both belong to the same table.
BEGIN;
DROP INDEX index1;
CREATE INDEX index2;
COMMIT;
This transaction acquires an ACCESS EXCLUSIVE lock during the DROP INDEX step and then acquires a SHARE lock during the CREATE INDEX step.
I understand that there will be no conflicts between the statements in this transaction, but I'm wondering if an outside transaction will think that the table has an ACCESS EXCLUSIVE lock until this entire transaction is completed.
Thanks