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 1f86CW-0001yQ-Os for pgsql-general@arkaria.postgresql.org; Mon, 16 Apr 2018 15:37:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f86CV-0003fE-08 for pgsql-general@arkaria.postgresql.org; Mon, 16 Apr 2018 15:37:51 +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.89) (envelope-from ) id 1f86CT-0003f4-83 for pgsql-general@lists.postgresql.org; Mon, 16 Apr 2018 15:37:50 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f86CP-0005ZR-Up for pgsql-general@lists.postgresql.org; Mon, 16 Apr 2018 15:37:48 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3F2D6208A7; Mon, 16 Apr 2018 11:37:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 16 Apr 2018 11:37:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=wNqZzH42lpBEl/U9jUKa1mgcV5Go/ CXIoE8GJitFc3U=; b=kuhNuMiSBGVJDMfevDZzP6uLvJTH4gisY5mR9oF9z4OJI MI1uVnG4ibHaJOz7S5txgxnvIXRzQmjQ5nWkYql2iDfIDDFyM4QjJ2LP9ETF1Ap3 LmHy6huyGaF8xcpwSEoLBnEpW20CLT2BZQnTUyinqIF3a2qHFlvTf1zTe5/4MnxV G2bCjXqB1X7mRF7qCtSXGs2rCU3rValeRtlBiZXWfitRLi2waHTORvpBGa5wfwo0 wJ7XfpxbLoeWo1ywIA8Mq88Bz3O/8crjwQ9YDYVYXE8w6V1g+vhVFrG+VNvMiiV2 pMTt16+MpGbrUz8kerIt0MGhj6C7ZWUomE/R7i0IQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=wNqZzH 42lpBEl/U9jUKa1mgcV5Go/CXIoE8GJitFc3U=; b=ecjCdBtUHRR+8uwLcGdjhW kruRLXk7IFpV/a0OnlUAIo3BHfLhiytxCal7xS4HQz6T927LNXpFZm2J365/nupP XXSqpWQB+ZRjEyl+Hsf79+90xnQZqeavpssb3HlfjjpF1x6EINPCJn9cdNqXmV7e ZKd9n3ic4+bFCGaqN+RduPwdMDu5LF8Lie2/A8Y1VBj4lYmqIKAwoNDtA1O40jju o2D53rac8a2OQs2aPdKictC1CkEncx77nfk9HoaBRzfjIT2GNH8kj4HB4guGa1qb NB+D47cYoeG+414IxysUKHJAe7INe48kf9FGexSVuVVG/8yTo7m6fUFo8qFb/C9Q == X-ME-Sender: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id B2B3210262; Mon, 16 Apr 2018 11:37:43 -0400 (EDT) Subject: Re: client_encoding issue with SQL_ASCII on 8.3 to 10 upgrade To: Keith Fiske , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Mon, 16 Apr 2018 08:37:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/16/2018 08:16 AM, Keith Fiske wrote: > Running into an issue with helping a client upgrade from 8.3 to 10 (yes, > I know, please keep the out of support comments to a minimum, thanks :). > > The old database was in SQL_ASCII and it needs to stay that way for now > unfortunately. The dump and restore itself works fine, but we're now > running into issues with some data returning encoding errors unless we > specifically set the client_encoding value to SQL_ASCII. > > Looking at the 8.3 database, it has the client_encoding value set to > UTF8 and queries seem to work fine. Is this just a bug in the old 8.3 > not enforcing encoding properly? > > The other thing I noticed on the 10 instance was that, while the LOCALE > was set to SQL_ASCII, the COLLATE and CTYPE values for the restored > databases were en_US.UTF-8. Could this be having an affect? Is there any > way to see what these values were on the old 8.3 database? The > pg_database catalog does not have these values stored back then. If I remember correctly: https://www.postgresql.org/docs/8.3/static/app-pgcontroldata.html > > -- > Keith Fiske > Senior Database Engineer > Crunchy Data - http://crunchydata.com -- Adrian Klaver adrian.klaver@aklaver.com