Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSOjF-0004AQ-63 for pgsql-general@arkaria.postgresql.org; Fri, 22 Dec 2017 14:55:17 +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 1eSOjE-0005iC-Oa for pgsql-general@arkaria.postgresql.org; Fri, 22 Dec 2017 14:55:16 +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 1eSOjE-0005hr-H1 for pgsql-general@lists.postgresql.org; Fri, 22 Dec 2017 14:55:16 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eSOjB-00076q-Bl for pgsql-general@postgresql.org; Fri, 22 Dec 2017 14:55:15 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id D258A4CC30; Fri, 22 Dec 2017 15:55:10 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id 0yTRvKnVVZ6x; Fri, 22 Dec 2017 15:55:02 +0100 (CET) Message-ID: <1513954500.2384.17.camel@cybertec.at> Subject: Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices From: Laurenz Albe To: rihad , pgsql-general General Date: Fri, 22 Dec 2017 15:55:00 +0100 In-Reply-To: References: <1513948189.2384.3.camel@cybertec.at> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk rihad wrote: > On 12/22/2017 05:09 PM, Laurenz Albe wrote: > > rihad wrote: > > > Hi there, this is a reproducible error. We recently pg_upgraded our > > > production database to 10.1 from 9.6.6. The upgrade runs fine with the > > > suggestion to analyze all data. > > > > [...] > > > > > Trying to find data using the specified indices fails to find matching rows: > > > > [...] > > > > > reindexing the table fixes the issue: > > > > Did you also upgrade the operating system or at least libc? > > It looks like it. > > $ ll /lib/libc.so.7 > -r--r--r-- 1 root wheel 1647104 Jun 19 2017 /lib/libc.so.7 > > this never was a major/minor OS upgrade, just whatever FreeBSD patch > releases included. > > > Then the problem could come from a modified collation. > > Compare https://www.postgresql.org/message-id/CB4D1C6BAA80CF146CB0D4F2%40eje.credativ.lan > > de (German) was just an example, the inability to find matching rows > affected other languages like fr or even en, too. > It does look like a collation issue, though. That would be the best thing, because it would mean that there is no PostgreSQL bug or hardware problem, and REINDEX will fix the problem. Yours, Laurenz Albe