Re: Question about tuple´s lock

Поиск
Список
Период
Сортировка
От Carlos Alves
Тема Re: Question about tuple´s lock
Дата
Msg-id d9f17f1f2c7f67bd376d6d8bb920ac4b@tecnisys.com.br
обсуждение исходный текст
Ответ на Re: Question about tuple´s lock  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

Em 24/10/2023 17:31, Tom Lane escreveu:

Carlos Alves <carlos.alves@tecnisys.com.br> writes:
I need some help to understand why a transaction wiht a row delete
aquire a AccessExclusiveLock and a row update a ExclusiveLock.

UPDATE can use the weaker lock type if it's not modifying any
column that is part of a unique index.  This is to allow concurrency
with foreign-key checks that might wish to grab a read-only (shared)
lock on such a tuple.

A DELETE, or an UPDATE that is modifying key columns, has to
conflict with foreign-key checks.

            regards, tom lane


Tom, 

thank you very much for your straight to the point answer!

regards
Carlos Alves


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question about tuple´s lock
Следующее
От: Brad White
Дата:
Сообщение: setting up streaming replication, part 2