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 1n74iF-00012r-6e for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Jan 2022 00:08:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n74iD-0006Tu-PQ for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Jan 2022 00:08:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n74iD-0006Tl-HZ for pgsql-bugs@lists.postgresql.org; Tue, 11 Jan 2022 00:08:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n74iB-00053M-0q for pgsql-bugs@lists.postgresql.org; Tue, 11 Jan 2022 00:08:29 +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 20B08OD82499550; Mon, 10 Jan 2022 19:08:24 -0500 From: Tom Lane To: atzedus@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17361: Unique index constraint inconsistence In-reply-to: <17361-912697ebdbbf37e9@postgresql.org> References: <17361-912697ebdbbf37e9@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 10 Jan 2022 22:29:06 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2499548.1641859704.1@sss.pgh.pa.us> Date: Mon, 10 Jan 2022 19:08:24 -0500 Message-ID: <2499549.1641859704@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: > Indexes: > "parts_stock_stat_pkey" PRIMARY KEY, btree (id) > "parts_stock_stat_lower_stock_type_id_idx" UNIQUE, btree (lower(name), > stock_type_id) > Following reindex command failed: > db=# reindex table parts_stock_stat; > ERROR: could not create unique index > "parts_stock_stat_lower_stock_type_id_idx" > DETAIL: Key (lower(name), stock_type_id)=(ha_hr/50, 4) is duplicated. How long have you had this database? If it's older than your last OS upgrade, it's possible that the index has become corrupt as a result of OS-level collation changes. See https://wiki.postgresql.org/wiki/Locale_data_changes regards, tom lane