Re: BUG #8290: broken/unexpected locking behavior

From: bricklen <bricklen(at)gmail(dot)com>
To: pgnube(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8290: broken/unexpected locking behavior
Date: 2013-07-09 16:57:26
Message-ID: CAGrpgQ-iDqTx_Oz2NTxKRZGhU8W4keRdbnh182Sm9S=DT+gXAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jul 9, 2013 at 9:02 AM, <pgnube(at)gmail(dot)com> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 8290
> Logged by: pgnoob
> Email address: pgnube(at)gmail(dot)com
> PostgreSQL version: 8.4.13
> Operating system: CentOS Linux
> Description:
>
> I experienced a db deadlock. After tracking down the problem I attributed
> it to some unusual locking behavior in postgresql where it acquires locks
> in
> an unexpected way that contributed to the deadlock.
>
>
> ALTER TABLE B ADD CONSTRAINT fkrefa FOREIGN KEY (a_id) REFERENCES A(id)
> MATCH FULL;
>

Try those steps again with the FK "DEFERRABLE INITIALLY DEFERRED"
Eg.
ALTER TABLE B ADD CONSTRAINT fkrefa FOREIGN KEY (a_id) REFERENCES A(id)
MATCH FULL deferrable initially deferred;

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pg noob 2013-07-09 17:59:20 Re: BUG #8290: broken/unexpected locking behavior
Previous Message pgnube 2013-07-09 16:02:22 BUG #8290: broken/unexpected locking behavior