Re: getting deadlocks on full table lock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: getting deadlocks on full table lock
Date: 2006-03-27 21:01:27
Message-ID: 17300.1143493287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
> I am getting a deadlock which I can't explain...although maybe
> somebody else can...here's teh situation:

TRUNCATE requires exclusive lock, and won't release it until end of
transaction. Since you've already read something from the target
table before attempting TRUNCATE, you already have AccessShareLock
and are attempting to acquire AccessExclusiveLock. Classic deadly
embrace.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message beer 2006-03-27 21:03:15 Issues with restoring
Previous Message Merlin Moncure 2006-03-27 20:53:51 getting deadlocks on full table lock