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 1nUAEw-0007vO-6b for pgsql-general@arkaria.postgresql.org; Tue, 15 Mar 2022 16:41:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nUAEu-0005gv-Tm for pgsql-general@arkaria.postgresql.org; Tue, 15 Mar 2022 16:41:40 +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 1nUAEu-0005gi-JQ for pgsql-general@lists.postgresql.org; Tue, 15 Mar 2022 16:41:40 +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 1nUAEs-0005qo-8J for pgsql-general@lists.postgresql.org; Tue, 15 Mar 2022 16:41:39 +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 22FGfZuQ328627; Tue, 15 Mar 2022 12:41:35 -0400 From: Tom Lane To: Jorel Casal cc: pgsql-general@lists.postgresql.org Subject: Re: Corrupt Index In-reply-to: References: Comments: In-reply-to Jorel Casal message dated "Tue, 15 Mar 2022 11:01:05 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <328625.1647362495.1@sss.pgh.pa.us> Date: Tue, 15 Mar 2022 12:41:35 -0400 Message-ID: <328626.1647362495@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jorel Casal writes: > During a Patroni leader switchover, we had a situation where a unique index > stopped "working", the index did not have records > that were in fact in the table and the table had duplicate records which > should have been prevented by said unique index. If the index was on a string type (text/varchar), the most likely explanation is a switch to a different OS version with inconsistent collation rules. See https://wiki.postgresql.org/wiki/Locale_data_changes regards, tom lane