Re: Question about tuple´s lock - Mailing list pgsql-general

From Carlos Alves
Subject Re: Question about tuple´s lock
Date
Msg-id d9f17f1f2c7f67bd376d6d8bb920ac4b@tecnisys.com.br
Whole thread Raw
In response to Re: Question about tuple´s lock  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Question about tuple´s lock
Next
From: Brad White
Date:
Subject: setting up streaming replication, part 2