Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOPCY-0007V1-7h for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Mar 2021 18:22:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lOPCW-0007kQ-Q8 for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Mar 2021 18:22:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOPCW-0007kI-JT for pgsql-bugs@lists.postgresql.org; Mon, 22 Mar 2021 18:22:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOPCU-0002I1-FQ for pgsql-bugs@lists.postgresql.org; Mon, 22 Mar 2021 18:22:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12MIMmng641365; Mon, 22 Mar 2021 14:22:48 -0400 From: Tom Lane To: susanacastela@hotmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16938: Duplicate records with same Primary Key In-reply-to: <16938-be6ffd557b1f523e@postgresql.org> References: <16938-be6ffd557b1f523e@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 22 Mar 2021 17:28:56 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <641363.1616437368.1@sss.pgh.pa.us> Date: Mon, 22 Mar 2021 14:22:48 -0400 Message-ID: <641364.1616437368@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > We're running an instance of postgres 13.2 and some days ago we noticed > duplicated rows with the same primary key. If the key column is of a text type, you might have gotten bit by operating-system-level changes of sorting rules, which would effectively make indexes on text columns corrupt [1]. If so, reindexing is the appropriate fix. There's work in progress to try to notice this sort of problem automatically, but it's not done yet. regards, tom lane [1] https://wiki.postgresql.org/wiki/Locale_data_changes