Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSOf5-0003vr-JC for pgsql-general@arkaria.postgresql.org; Fri, 22 Dec 2017 14:50:59 +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 1eSOf4-0000Qr-Ir for pgsql-general@arkaria.postgresql.org; Fri, 22 Dec 2017 14:50:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eSOf4-0000Qh-7z for pgsql-general@lists.postgresql.org; Fri, 22 Dec 2017 14:50:58 +0000 Received: from smtp39.i.mail.ru ([94.100.177.99]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eSOex-0005xv-0g for pgsql-general@postgresql.org; Fri, 22 Dec 2017 14:50:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=0fjoq6cUOWZxhELepA11bv0Sg8VqZsBej0eTTd+eKvk=; b=dFMtU3SbDSPMqV7dV0XlrkHW999eZ+G/K5eNUleUfL7mdrv3x8k/TT7cqBjFCcDA3V+qAZtB9Ln4ojjf1YtZ+H6MeHAC4ucb+ih4QpmH5P9tPhkuup/hJ2bmf97KID4KcQ098zi2uiI/DbIe2P1hlN9aNQR91hf1YHfdAm/jkVw=; Received: by smtp39.i.mail.ru with esmtpa (envelope-from ) id 1eSOet-000739-G9; Fri, 22 Dec 2017 17:50:48 +0300 Subject: Re: pg_upgrading to 10.1 corrupts (varchar,varchar) UNIQUE indices To: Laurenz Albe , pgsql-general General References: <1513948189.2384.3.camel@cybertec.at> From: rihad Message-ID: Date: Fri, 22 Dec 2017 18:50:44 +0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1513948189.2384.3.camel@cybertec.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: smtp39.i.mail.ru; auth=pass smtp.auth=rihad@mail.ru smtp.mailfrom=rihad@mail.ru X-7FA49CB5: 0D63561A33F958A5B354F6EDF64AECF63A5C57081CD8FBEFD6DA01A2A47BD3AB725E5C173C3A84C3C8F21CEC4765490DFD480C337E3B3D27F65A62F6C9828292C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F2AF38021CC9F462D574AF45C6390F7469DAA53EE0834AAEE X-Mailru-Sender: B19AB4DAF1EA2FB58A8BBB454389F7B4693086EED7BB40E0390BB6175DD8D309064B8FEF34F63F30ABBFE0CF075BC50BFB559BB5D741EB96004FA9CEFBA991DA3A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.