Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQxgj-0003hx-Fs for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Dec 2017 15:50:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQxgj-0006XI-2m for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Dec 2017 15:50:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eQxgi-0006X8-QN for pgsql-bugs@lists.postgresql.org; Mon, 18 Dec 2017 15:50:44 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eQxgg-00023s-AA for pgsql-bugs@postgresql.org; Mon, 18 Dec 2017 15:50:43 +0000 Received: by mail-wm0-x232.google.com with SMTP id t8so29941856wmc.3 for ; Mon, 18 Dec 2017 07:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=m9oKZMyPTPkk+0/Kuce9G5382dEiRSLrvDbMKlEZH4I=; b=RkZddO2KWxyYnlV09MqE1+LsX3TfFlOgPXQR0opt9eEDKxIryl62Zk/qIT06LzvPfK gkj8rRv0KknMOSjIib/8+7ofUvipmVMdsTq1+AUazHmosHg44K59MKvOF+Li/Ze/15kM 2AgDN+WhX3FAL3g4kbHwKxTiGJLv0SS2NoN+S9Ezn5nR2jyHKKEBGz7ZJuBAOkTYrksi uudDnUfDcKoERSaQLWEAwRvYtHzC9cwoDH+4o98Bwu++osEqIobbZ/BlowLf+UftEO89 VuFHAI0SYL4qPJ1CLXlyHHJ0MQR+ea/YSnSMD9w1gRN9A/iSkEjrT5RWWXyEqfpzXjSI LAVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=m9oKZMyPTPkk+0/Kuce9G5382dEiRSLrvDbMKlEZH4I=; b=QgTVdAsCITaU/GkryOPYck78qqx3QFZvL6C+c7ZBnz7LPPtI3XZn1nk2GDWh9TnnzV 0vnPmx9AJplpryXmc/azqrG1VQ6mK/QxKifPiGDwK8QtrSlYx8D7XvGO5YGASscYd0DH 1xe9DYlBAopOdxwNbLyVVOd03nmPAUjxa5nRvKQ4PI3sNJQghD/axbjTMwJ0e2Sdymuj fry3VyKDzp0po0JFUuvQ1arOirS577iTgjZ3D13fH4LS94YED8Il+o7NHKfnBmRKL0Sy BjbivctKxIc1CdhCfHqabB7hZqvt5XqFdUlu4Jm799QmljjHP5rvEK70y0LEjDhuvYhF REVg== X-Gm-Message-State: AKGB3mJFNS7u7o6A/Ist+rQ7AwvOM34AQcyDiXtfZ1rNPmPrV1S9asS9 BeZjFwjnVnR4RgQ0KZDtpRcpEUYCt1wk8sAuW+qW++UxC8uo3oH9zHT+wBbkc7lHFfmVOBAVTNb 8RxpKyXnE1ZYqKjRKa0XGcUyxElnmeEiSueTtlXBGiWf6u9cYym2iGtCse5Sc9my6kLXHatcS91 yr14gd X-Google-Smtp-Source: ACJfBovldRxtXPNdt/EG349+5S8Uog1eBn2ZyKnH6yCbELeY0IperxLYIHS57AoU1ujvAP1ehn5rgA== X-Received: by 10.28.172.66 with SMTP id v63mr69658wme.37.1513612239152; Mon, 18 Dec 2017 07:50:39 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id h56sm11066497eda.97.2017.12.18.07.50.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 07:50:38 -0800 (PST) Subject: Re: BUG #14940: Duplicated records inspite of primary key and unique constraint To: =?UTF-8?B?0KHQtdGA0LPQtdC5INCQLiDQpNGA0L7Qu9C+0LI=?= , Alvaro Herrera Cc: pgsql-bugs@postgresql.org References: <20171201171513.if4pd67kh5sl7u53@alvherre.pgsql> <023c1715-3a10-1a4d-6efd-ccb8823fdfb8@smetarik.ru> <2e9f0483-f084-53e9-e80b-bf112f9a6053@2ndquadrant.com> <4dc917b7-6edb-01d5-1c91-27ad7e9f12da@2ndquadrant.com> <0a05427a-aeb4-05f7-f0c6-1c5052b9f557@smetarik.ru> From: Tomas Vondra Message-ID: <1e30f745-740b-5bf0-3699-a62a04e2a402@2ndquadrant.com> Date: Mon, 18 Dec 2017 16:50:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/18/2017 04:28 PM, Сергей А. Фролов wrote: > Hi, > > I have got a VirtualBox with Debian  8.3 and have installed PG 9.6 and > amcheck: > > select version () > "PostgreSQL 9.6.6 on i686-pc-linux-gnu, compiled by gcc (Debian > 4.9.2-10) 4.9.2, 32-bit" > > No errors were raised by amcheck: > SELECT bt_index_check(index => indexrelid, heapallindexed => > true),bt_index_parent_check(index =>indexrelid), relname, indexrelname >     FROM pg_stat_all_indexes >     WHERE indexrelname in ('pk_nb_basedtl','unq_nb_basedtl_basenorm'); > > "";"";"nb_basedtl";"pk_nb_basedtl" > "";"";"nb_basedtl";"unq_nb_basedtl_basenorm" > > BUT duplicate rows were restored via pg_dump/pg_restore. > select ctid,xmin,xmax, id, base_id, norm_id from nb.nb_basedtl where id > =11658502; > > (0,49);5513;0;11658502;269;46203 > (0,49);5518;0;11658502;269;46203 > (0,49);5519;0;11658502;269;46203 > So, can you create a reproducer? That is, share the pg_dump export (for this one table) which we could use to reproduce the issue? That would make investigation so much simpler. regard -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services