Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f86tF-0004xA-9D for pgsql-general@arkaria.postgresql.org; Mon, 16 Apr 2018 16:22:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f86tD-0004qA-GK for pgsql-general@arkaria.postgresql.org; Mon, 16 Apr 2018 16:21:59 +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.89) (envelope-from ) id 1f86tD-0004q0-8O for pgsql-general@lists.postgresql.org; Mon, 16 Apr 2018 16:21:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f86t5-00011i-MJ for pgsql-general@lists.postgresql.org; Mon, 16 Apr 2018 16:21:58 +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 w3GGLm47011210; Mon, 16 Apr 2018 12:21:48 -0400 From: Tom Lane To: Keith Fiske cc: pgsql-general@lists.postgresql.org Subject: Re: client_encoding issue with SQL_ASCII on 8.3 to 10 upgrade In-reply-to: References: <10581.1523894949@sss.pgh.pa.us> Comments: In-reply-to Keith Fiske message dated "Mon, 16 Apr 2018 12:16:48 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11208.1523895708.1@sss.pgh.pa.us> Date: Mon, 16 Apr 2018 12:21:48 -0400 Message-ID: <11209.1523895708@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Keith Fiske writes: > On Mon, Apr 16, 2018 at 12:09 PM, Tom Lane wrote: >> This is not a great idea, no. You could be getting strange misbehaviors >> in e.g. string comparison, because strcoll() will expect UTF8 data and >> will likely not cope well with data that isn't valid in that encoding. > And pg_controldata was able to show that the CTYPE and COLLATE were UTF8 on > the old system. If that's the case, do you still think it's a good idea to > set the COLLATE and CTYPE to "C"? Well, if the customer's been happy with the behavior of the system so far, maybe it's all right. But this is sure the first thing I'd look at if there are any gripes about its behavior with non-UTF8 strings. I'd be especially worried about this if you try to migrate the database to any new platform, as it's a bet about the behavior of libc not PG itself. regards, tom lane