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

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



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: setting up streaming replication
Next
From: Carlos Alves
Date:
Subject: Re: Question about tuple´s lock