Re: getting deadlocks on full table lock - Mailing list pgsql-general

From Tom Lane
Subject Re: getting deadlocks on full table lock
Date
Msg-id 17300.1143493287@sss.pgh.pa.us
Whole thread Raw
In response to getting deadlocks on full table lock  ("Merlin Moncure" <mmoncure@gmail.com>)
Responses Re: getting deadlocks on full table lock
List pgsql-general
"Merlin Moncure" <mmoncure@gmail.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

pgsql-general by date:

Previous
From: "Merlin Moncure"
Date:
Subject: getting deadlocks on full table lock
Next
From: "beer"
Date:
Subject: Issues with restoring