Re: AccessExclusiveLock with pg_locks.locktype of tuple

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Erik Jones <mage2k(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: AccessExclusiveLock with pg_locks.locktype of tuple
Date: 2019-12-19 00:06:27
Message-ID: 32763.1576713987@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Erik Jones <mage2k(at)gmail(dot)com> writes:
> I've seen locks with mode of AccessExclusiveLock and locktype of tuple a
> few times now but have never been able to reproduce one nor had a chance to
> dig into them and now have a couple questions on them:
> * When is this kind of heavy lock on a row/tuple taken out? I've done some
> code spelunking but have yet to find anything.

It's a transient state while waiting to acquire a "normal" tuple lock,
that is one recorded in the tuple header. The explanation can be found
in src/backend/access/heap/README.tuplock, and the relevant code is
mostly in heap_lock_tuple().

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2019-12-19 06:54:47 Re: READ UNCOMMITTED in postgres
Previous Message Stephen Frost 2019-12-18 23:20:03 Re: READ UNCOMMITTED in postgres