From: Carlos Alves <carlos.alves@tecnisys.com.br>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Question about tuple´s lock
Date: Tue, 24 Oct 2023 17:43:07 -0300
Message-ID: <d9f17f1f2c7f67bd376d6d8bb920ac4b@tecnisys.com.br> (raw)
In-Reply-To: <849349.1698179507@sss.pgh.pa.us>
References: <2fa29bee5e4a7c369f54f02198423814@tecnisys.com.br>
<849349.1698179507@sss.pgh.pa.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: carlos.alves@tecnisys.com.br, tgl@sss.pgh.pa.us
Subject: Re: Question about tuple´s lock
In-Reply-To: <d9f17f1f2c7f67bd376d6d8bb920ac4b@tecnisys.com.br>
References: <2fa29bee5e4a7c369f54f02198423814@tecnisys.com.br> <849349.1698179507@sss.pgh.pa.us> <d9f17f1f2c7f67bd376d6d8bb920ac4b@tecnisys.com.br>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox