Re: Question about tuple´s lock

From: Carlos Alves <carlos(dot)alves(at)tecnisys(dot)com(dot)br>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Question about tuple´s lock
Date: 2023-10-24 20:43:07
Message-ID: d9f17f1f2c7f67bd376d6d8bb920ac4b@tecnisys.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

> Carlos Alves <carlos(dot)alves(at)tecnisys(dot)com(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brad White 2023-10-25 00:29:33 setting up streaming replication, part 2
Previous Message Tom Lane 2023-10-24 20:31:47 Re: Question about tuple´s lock