pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: sergey.frolov@smetarik.ru
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14940: Duplicated records inspite of primary key and unique constraint
Date: Fri, 1 Dec 2017 18:17:45 +0100
Message-ID: <5908ac7d-875d-0575-c6fb-06e2985e2986@2ndquadrant.com> (raw)
In-Reply-To: <20171201171513.if4pd67kh5sl7u53@alvherre.pgsql>
References: <20171201171513.if4pd67kh5sl7u53@alvherre.pgsql>



On 12/01/2017 06:15 PM, Alvaro Herrera wrote:
> 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
> 

Oh, haven't noticed this. I wonder if the other cases (supposedly there
are 50 duplicate records) look the same way.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (16+ messages)  latest in thread

Message-ID: <5908ac7d-875d-0575-c6fb-06e2985e2986@2ndquadrant.com>
Permalink:  ../5908ac7d-875d-0575-c6fb-06e2985e2986@2ndquadrant.com/
Also on:    postgresql.org/message-id/5908ac7d-875d-0575-c6fb-06e2985e2986@2ndquadrant.com

 · 

reply

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: tomas.vondra@2ndquadrant.com, alvherre@alvh.no-ip.org, sergey.frolov@smetarik.ru
  Subject: Re: BUG #14940: Duplicated records inspite of primary key and unique constraint
  In-Reply-To: <5908ac7d-875d-0575-c6fb-06e2985e2986@2ndquadrant.com>
  References: <20171201171513.if4pd67kh5sl7u53@alvherre.pgsql> <5908ac7d-875d-0575-c6fb-06e2985e2986@2ndquadrant.com>

* 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