Table-Level Locks and Transactions

Поиск
Список
Период
Сортировка
От Greg Rychlewski
Тема Table-Level Locks and Transactions
Дата
Msg-id CAKemG7XD-UU7AGan+jp5jtw+6wwcN4z3pPSB=DuoAC1z3JDDhg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Table-Level Locks and Transactions  (Simon Riggs <simon.riggs@enterprisedb.com>)
Список pgsql-novice
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

В списке pgsql-novice по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Simple question about running a function.
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Table-Level Locks and Transactions