Re: BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes
Date
Msg-id 30153.1455127298@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re[2]: [BUGS] BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes
List pgsql-bugs
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I wonder if you got into this state by adding primary keys concurrently
> somehow.  That should of course not be allowed, but of course there is
> no UNIQUE constraint on conrelid itself, so the normal unique-ification
> code in btree does not fire for this situation.

I thought maybe Simon's changes to reduce lock levels in ALTER TABLE
had gone too far, but simple experiment shows that ALTER ADD PRIMARY KEY
commands still block each other (and then the second one fails as
expected).  So there isn't an obvious hole here.

Given that the OIDs are different, it seems more likely that this is the
result of a primary key being dropped and then re-created, and later
somehow the commit state of the original row got reverted.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13941: Different value "pg_constraint.consrc" for similar Check Constrait
Next
From: Andres Freund
Date:
Subject: Re: BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes