Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tn5Gb-0004Zu-JS for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Dec 2012 10:28:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tn5Gb-0008D3-2S for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Dec 2012 10:28:17 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tn5GZ-0008C9-AP for pgsql-bugs@postgresql.org; Mon, 24 Dec 2012 10:28:15 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tn5GX-0007cZ-F7 for pgsql-bugs@postgresql.org; Mon, 24 Dec 2012 10:28:14 +0000 Received: from [10.1.1.6] (124-148-105-147.dyn.iinet.net.au [124.148.105.147]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MQdCf-1TdTxV20Z3-00UDps; Mon, 24 Dec 2012 11:28:10 +0100 Message-ID: <50D82E31.2030708@2ndquadrant.com> Date: Mon, 24 Dec 2012 18:28:01 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: acummings@aperiogroup.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7760: records with duplicate primary keys References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:hmj6C+MpfaEmYZ5Pn3hb91x7sA9ScxJl/FxRUYKcaSB iKlE8JL7YAhzdW3TTvbhY1zIh65cxg9FG+uj1LLJpPce3KMizd dK8+Gl62LgA3tn4BFB4jG8ZDTRREInfG3Ky9b5jm69l6+57GkM C6olafLJwBcNFw/r5ENvcB4x4F7yhIWoKgxGqhJtp0Y8XCZwz9 H14fd60ruGP/wDjFRGgg+63C/barjaZLiRxaDbjAhPvZA7WUMz yUHgeAJMbx0NjIrYtUM6EKsGxnpEkTuAINYjuc/VFRNvrxNQr6 18tOJz2dt7et4QxPXsuNxBRkg5ZkGryIbdJukk9mOS12j/MheX Y6KO0oFKdPlbBA0mO3oo= X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 20/12/2012 1:22 AM, acummings@aperiogroup.com wrote: > The following bug has been logged on the website: > > Bug reference: 7760 > Logged by: Alan Cummings > Email address: acummings@aperiogroup.com > PostgreSQL version: 9.1.7 > Operating system: Ubuntu Linux 10.04.1 > Description: > > We found 6 duplicated primary keys in a table. All fields were identical in > the duplicated records, including the primary key. (Total records ~ 22,000). > We recently updated from 9.1.2 to 9.1.7, so the issue may have been present > in 9.1.2. Have you had your database running with fsync=off at any point? What storage system is the database on? RAID array? If so, details - drive types, controller if any, writeback/writethrough, BBU enabled,etc? SSD, and if so which SSD? Has the DB host unexpectedly powered off or rebooted at any point? This should never cause a problem unless you run with unsafe settings like fsync=off, but is important to know. Did you REINDEX as part of the upgrade to 9.1.7? A corrupt unique index could hide duplicate records, and a reindex might well cause the problem to become apparent. > We have fixed the issue in our table by backing up the table in pgAdmin to a > plain file, deleting the duplicated records in the text file, then restoring > the table. > > I can send the original backup with the duplicated records if that would be > helpful -- it is about 11MB. Is the backup a `pg_dump`? Or a raw copy of the database directory? The pg_dump output won't usually provide much information, it's the actual database on disk that's significant. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, 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