On Wed, 2 Dec 2015 09:01:37 -0800
Christophe Pettus <x...@thebuild.com> wrote:

> On 9.4, I've encountered a locking message I've not seen before:
> 
>       process 5293 still waiting for AccessExclusiveLock on tuple (88636,15) 
> of relation 18238 of database 16415 after 5000.045 ms
> 
> What conditions produce an "AccessExclusiveLock on tuple"?  Attempting to 
> lock a tuple when another process has done an explicit LOCK ACCESS EXCLUSIVE?

No. See the section on row level locks here:
http://www.postgresql.org/docs/9.4/static/explicit-locking.html

Essentially, any data modification could take an exclusive lock on the row(s)
that it's going to modify. Generally, this will be an UPDATE statement,
although the same thing happens when you do SELECT ... FOR UPDATE.

The message you're seeing simply means that one process has been waiting for
a long time for the lock to release (5 seconds in this case). Deadlocks are
automatically handled, so this is not a deadlock. Although if the process
holding the lock does not commit the transaction, the waiting process will
wait indefinitely.

If this is happening infrequently, it's probably of no concern. If it's
happening frequently, you'll want to investigate what process is holding
the locks for so long and see what can be done about it.

-- 
Bill Moran


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to