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.92) (envelope-from ) id 1jEDTg-00025u-4k for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 14:45:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jEDTe-0002ms-P1 for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 14:45:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jEDTe-0002ml-Be for pgsql-general@lists.postgresql.org; Tue, 17 Mar 2020 14:45:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEDTb-0003lh-Jw for pgsql-general@postgresql.org; Tue, 17 Mar 2020 14:45:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02HEjo6L001183; Tue, 17 Mar 2020 10:45:50 -0400 From: Tom Lane To: Don Seiler cc: Postgres General Subject: Re: Mixed Locales and Upgrading In-reply-to: References: <5624.1584372534@sss.pgh.pa.us> <31606.1584453361@sss.pgh.pa.us> Comments: In-reply-to Don Seiler message dated "Tue, 17 Mar 2020 09:35:51 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1181.1584456350.1@sss.pgh.pa.us> Date: Tue, 17 Mar 2020 10:45:50 -0400 Message-ID: <1182.1584456350@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Don Seiler writes: > On Tue, Mar 17, 2020 at 8:56 AM Tom Lane wrote: >> Yikes. Well, if there aren't obvious operational problems, it might be >> that the data is actually UTF8-clean, or almost entirely so. Maybe you >> could look at the problem as being one of validation. > For this test, would we restore into an en_US.UTF-8/UTF8 database? Then, > assuming no errors (or fixing any errors until clean), we change the > datcollate/datctype settings in prod and proceed with pg_upgrade (obviously > after testing all of that heavily)? Yeah, that's the basic idea. > What are the ramifications of changing collation like that? Should we > consider rebuilding indexes ASAP after that? Text indexes would definitely be at risk here. I'm not really certain how bad the problem would be. Do you have a feeling for how much of the data is 100% ASCII? If you could be sure of that for any given column, you wouldn't have to reindex indexes on that column. regards, tom lane