Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKomh-0003eD-1j for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Dec 2017 17:07:31 +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 1eKomg-00007v-4u for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Dec 2017 17:07:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eKomf-00007l-Ri for pgsql-bugs@lists.postgresql.org; Fri, 01 Dec 2017 17:07:30 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eKomX-0001wB-V1 for pgsql-bugs@postgresql.org; Fri, 01 Dec 2017 17:07:29 +0000 Received: by mail-wm0-x234.google.com with SMTP id i11so4512708wmf.4 for ; Fri, 01 Dec 2017 09:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Nnll2be23omKUraFE71xNxbDjeT/xng5NV5DAIY4hJc=; b=e16GeidKrfkcUnsQhqcv6qzJVp/qrCcPGGf5VUutJ00dD9fDiwYvLZZ/oIlE/rR6UC Lb78/tCFDf3a4tD+WnuzO1k2bvjx0TwZNfFVL7MR96mV0pdg0Uh12SOWhey06Z+46oQz iCf2fyNWR2kX65I0l0/ot3zOjNcaosaVK1wBMZTRiUJ+lnKnvv6ntkasnlxTQGN0lvaU 1xtsZ3UnQxU2eXDUkyUz0Y8LEXvFBcKFR8A7qgZNJYw9JkJKluJIrJXldwlquFLWyt0F on1Pzr3Ap1c512TBmQ8bKk7L34H1W3SFX0nMJv9xlBPYr9uACMQZ+/TxVBQY8E5fuAQl naxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Nnll2be23omKUraFE71xNxbDjeT/xng5NV5DAIY4hJc=; b=ZGxgKVTctFpEaP8JFzl8l/sT5H9SvmH/Nqa8W0OFLQ/8OW9KN4meIDbn9ThODn504i LBBEo1Hk4ByEJrGOus1oJ5Lv7fUaG4O75GFz21y4C0ZTvYlTmn9UighjyZhTDX6/Hdn1 JId3HPBP+nkThOGXhAgNuX7iH2HLsmCbOH1cWZ/MKXjyue4RM23GdZfT0mLfYhmOCPT4 Np3Mq2/ZD5lrlLB5EjtNavqR6JEyQzKbv7QqLySwpTg6OING7b6RrOrh09Nxoh1xmFTu EHWo/6/RrKRRcmYTPsrzGjWPH4Lub//fOet7LrCwzbtg3VJMtBq1bVCMh/++6+wgtP1Z PnKw== X-Gm-Message-State: AJaThX4I/oY7QRX/hbLpn9JyYm1lsNVtI73o5oH7j9AJ89kjBiYNB4fQ snFKYyZ0eXq97tG6iOAYnulOWCQMmVTLENwxN10MW7g+nvTN/vJidvxixnykJIaz60/6Q0umDWg dxYD2FP73Yp2Dfk4TqTuxk7d6BX6pQRYUksjJf+RIzv1CEoizwgmkInY7SdEYv38ojMsiL6ZItR uWNQ5s X-Google-Smtp-Source: AGs4zMbsB1tm4r9Me++U09DL9jiGya0R8vrIQtDhClztpMU0oun65+7zdUwsvst+DhMJZKuWMscJnA== X-Received: by 10.28.88.137 with SMTP id m131mr1759479wmb.48.1512148038262; Fri, 01 Dec 2017 09:07:18 -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 e40sm6253697wre.6.2017.12.01.09.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 09:07:10 -0800 (PST) Subject: Re: BUG #14940: Duplicated records inspite of primary key and unique constraint To: =?UTF-8?B?0KHQtdGA0LPQtdC5INCQLiDQpNGA0L7Qu9C+0LI=?= , pgsql-bugs@postgresql.org References: <20171201124533.27099.26427@wrigleys.postgresql.org> From: Tomas Vondra Message-ID: <73627a9c-9229-66fa-c285-1eaec1a9eaa2@2ndquadrant.com> Date: Fri, 1 Dec 2017 18:07:08 +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 Hi, On 12/01/2017 04:19 PM, Сергей А. Фролов wrote: > The database was created at october 2016 on PG 9.5.3 then > backuped/restored into PG 9.6.5 and then backuped/restored into PG 9.6.6. > > I am sure that the ~10 problematic records were added on PG 9.6.5. and > ~40  were added on  PG 9.6.6. > By backup/restore you mean pg_dump? If that's the case, it's pretty sure the duplicates happened on 9.6.6 (otherwise the restore would fail). But that contradicts the 9.6.5 -> 9.6.6 upgrade, if your claim that 10 duplicates originate on 9.6.5 is correct. BTW are you running vanilla PostgreSQL, or some of the EDB versions? > The file systems is NTFS. > > Windows 10 runs as virtual machine under Hyper-V. Windows logs contains > nothing suspicious on both. > No idea. My experience with modern Windows systems is minimal, but I suppose it certainly shouldn't corrupt data in normal operation. > I have wrote the script to generate  select to check for duplicates all > tables in all schemas - all other tables are OK. > > The only problem I observed - the PG dbugger hanged once and we had to > kill related postgres process via taskmanager (killing session had no > effect) , but I am shure that the killed session did not touch the > problem table at all. > Not sure which debugger you mean, but again - killing a process should not result in data corruption. It may cause the database to crash and perform recovery, but that's about it. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services