From: Tom Lane <tgl@sss.pgh.pa.us>
To: Erik Jones <mage2k@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: AccessExclusiveLock with pg_locks.locktype of tuple
Date: Wed, 18 Dec 2019 19:06:27 -0500
Message-ID: <32763.1576713987@sss.pgh.pa.us> (raw)
In-Reply-To: <CABX4GUvwPBm8a4RnZVTsXAC=WAJkwYF7_ZaJX3jbSw5XnWRVGA@mail.gmail.com>
References: <CABX4GUvwPBm8a4RnZVTsXAC=WAJkwYF7_ZaJX3jbSw5XnWRVGA@mail.gmail.com>
Erik Jones <mage2k@gmail.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
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: tgl@sss.pgh.pa.us, mage2k@gmail.com
Subject: Re: AccessExclusiveLock with pg_locks.locktype of tuple
In-Reply-To: <32763.1576713987@sss.pgh.pa.us>
References: <CABX4GUvwPBm8a4RnZVTsXAC=WAJkwYF7_ZaJX3jbSw5XnWRVGA@mail.gmail.com> <32763.1576713987@sss.pgh.pa.us>
* 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