On 3/27/06, Tom Lane <[EMAIL PROTECTED]> wrote:
> "Merlin Moncure" <[EMAIL PROTECTED]> writes:
> > I am getting a deadlock which I can't explain...although maybe
> > somebody else can...here's the 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.
duh. Anyways, I moved the update() above read part and this
eliminated most of the deadlocks...but I still got a few. Throwing a
'lock table mat_table' before truncate killed them all though.
Merlin
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq