From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: bear2k@mail.ru
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes
Date: Wed, 10 Feb 2016 13:52:22 -0300
Message-ID: <20160210165222.GA347443@alvherre.pgsql> (raw)
In-Reply-To: <20160208163222.2661.51608@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
bear2k@mail.ru wrote:
> First, select rows with segment scan:
>
> # select oid,ctid,xmin,xmax,conrelid,contype from pg_constraint where
> conrelid::int + 0 = 50621;
> oid | ctid | xmin | xmax | conrelid | contype
> --------+---------+---------+------+----------+---------
> 301952 | (6,136) | 4883898 | 0 | 50621 | p
> 300466 | (7,1) | 4786734 | 0 | 50621 | p
> (2 rows)
We've had reports of duplicate rows appearing in user tables, where only
one copy is visible through indexes, but most updates of pg_constraint
don't go through the normal executor, but rather direct catalog
manipulation of DDL implementation, so I'd be surprising if it's the
same thing. Also, the OIDs of the two rows are different, so really the
two physical rows are not update copies of the same logical row.
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.
Perhaps we have a bug in some ALTER TABLE command. Can you tell us how
you created the PK in the affected table?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, bear2k@mail.ru
Subject: Re: BUG #13935: Duplicate row in pg_constraint table which is not accessible via indexes
In-Reply-To: <20160210165222.GA347443@alvherre.pgsql>
References: <20160208163222.2661.51608@wrigleys.postgresql.org> <20160210165222.GA347443@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox