Re: Question about tuple´s lock

2023-10-24 Thread Carlos Alves
Em 24/10/2023 17:31, Tom Lane escreveu: > Carlos Alves 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

Re: Question about tuple´s lock

2023-10-24 Thread Tom Lane
Carlos Alves 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 forei

Re: Question about tuple´s lock

2023-10-24 Thread Carlos Alves
Em 24/10/2023 13:27, Carlos Alves escreveu: > Hi! > > I need some help to understand why a transaction wiht a row delete aquire a > AccessExclusiveLock and a row update a ExclusiveLock. > > To ilustrate, a made this scenario: > > create table tblock > > ( > > id int primary key, > > v