Re: BUG #14940: Duplicated records inspite of primary key and uniqueconstraint - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #14940: Duplicated records inspite of primary key and uniqueconstraint
Date
Msg-id 20171201171513.if4pd67kh5sl7u53@alvherre.pgsql
Whole thread Raw
In response to BUG #14940: Duplicated records inspite of primary key and uniqueconstraint  (sergey.frolov@smetarik.ru)
Responses Re: BUG #14940: Duplicated records inspite of primary key and uniqueconstraint  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Re: BUG #14940: Duplicated records inspite of primary key and uniqueconstraint  (Сергей А. Фролов<sergey.frolov@smetarik.ru>)
List pgsql-bugs
sergey.frolov@smetarik.ru wrote:

> select ctid,xmin,xmax, id, base_id, norm_id from nb.nb_basedtl where id =
> 11658502 ;-- expected ONE row 
> 
> (0,49);364507;0;11658502;269;46203
> (0,49);370881;0;11658502;269;46203
> (0,49);370882;0;11658502;269;46203

Since these rows all have the same CTID, it looks like the index on id
must be corrupt and returned the same tuple more than once.  But the
weird thing is that the xmin differs ...  How can that be?  Does this
change if you set enable_indexscan and enable_bitmapscan to off?

Would you try running amcheck on this index?
https://github.com/petergeoghegan/amcheck

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-bugs by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: BUG #14940: Duplicated records inspite of primary key and uniqueconstraint
Next
From: Tomas Vondra
Date:
Subject: Re: BUG #14941: Vacuum crashes