Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1is9X3-0000Tj-DK for pgsql-general@arkaria.postgresql.org; Thu, 16 Jan 2020 18:06:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1is9X1-0007eL-UR for pgsql-general@arkaria.postgresql.org; Thu, 16 Jan 2020 18:06:11 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1is9X1-0007eD-JU for pgsql-general@lists.postgresql.org; Thu, 16 Jan 2020 18:06:11 +0000 Received: from polemos.matrix.org ([94.237.46.156]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1is9Ww-00074n-DP for pgsql-general@lists.postgresql.org; Thu, 16 Jan 2020 18:06:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=matrix.org; s=polemos; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version :Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=L+mel2HGih2SmYjKpnwQCS6UZG8l6s8N0x5T3lAhyhs=; b=ECutcvZmSADjTiMeHDk/MoOZwF joU0Gtqa9bM5QICJQPtbqYn4G9Lqmm+yPx1kRGzTrGnWBX1WTlRm09DoGHd2NodOq7IyyMxOIwTaG xWaZCrQqZ0VxO/kPWdOlq2/hiPpYKFYQOCfgm2nt7DCzAQZB8h/EDanc0br96G1EhYSC2t+eglHB4 fiZueoH8wRTN4YdteYYUgIy6W1DWlYse0ZjGa0jhD3uFv+n1seJU5Qxrjj6PZhAQjPjrxNMh3PQmj ag2IOdWYKB/DxE2Kfwqq7eyXLtm6KWK1FYUolqEojBEIZLmlGqAHjfHqmWN9RVJWb4RN8QLgMBHVP rJXBjnvUc70S8Bj1FZgvW7+F8EGpN4hpFspuQYn8NHxFwKuqL7wjfzlyrseJnISCB9O7Zl9bKSu9e VpqulAQuPCux6wIHmLQY5SqgaB5QsrPaWa+9DlmMrtcoSN0GFHUpOSZWrN0agIif9weO8wK1BsZUz tdjpWP2wjsxezrw5SYcopcdOWCNm4FCyS+5UMYx8/7cS8wOOB7/lXiiSCiYVw0eWV3khTs1OmpNMQ Pm4jisEwv2HeCvxQzyhW63enFEYplUJRq1g9NjWDMaGMIQCMlShHWRoqqpC0PrrF/Y6UtiR9cxLuW ecSQ0uRhSMYVTTQtRXWC8j70knHy23Ou4ThXk1UNk=; Received: from [2001:8b0:ba7a:e98f:2d18:c4bf:423e:ed6f] by polemos.matrix.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1is9Wv-00013T-8y; Thu, 16 Jan 2020 18:06:05 +0000 Subject: Re: Inexplicable duplicate rows with unique constraint To: Tom Lane Cc: pgsql-general@lists.postgresql.org References: <288488b7-d3b6-905b-3706-43f7a3c7bc52@matrix.org> <1605.1579194518@sss.pgh.pa.us> <3248.1579196886@sss.pgh.pa.us> From: Richard van der Hoff Message-ID: <579c492c-350f-2841-ed4c-94b2f904a4bb@matrix.org> Date: Thu, 16 Jan 2020 18:06:04 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <3248.1579196886@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 16/01/2020 17:48, Tom Lane wrote: > Richard van der Hoff writes: >> On 16/01/2020 17:12, Magnus Hagander wrote: >>> See https://wiki.postgresql.org/wiki/Locale_data_changes for hints on >>> which linux distros updated when. > >> It seems like a plausible explanation but it's worth noting that all the >> indexed data here is (despite being in text columns), plain ascii. I'm >> surprised that a change in collation rules would change the sorting of >> such strings, and hence that it could lead to this problem. Am I naive? > > Unfortunately, strings containing punctuation do sort differently > after these changes, even with all-ASCII data. The example given > on that wiki page demonstrates this. Thank you Tom. I should learn to read properly. I think this very much explains the symptoms we're seeing. Thanks very much for the detailed and very helpful answers!