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 1f88Na-0002oc-I3 for pgsql-general@arkaria.postgresql.org; Mon, 16 Apr 2018 17:57:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f88NZ-0001eX-Aj for pgsql-general@arkaria.postgresql.org; Mon, 16 Apr 2018 17:57:25 +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 1f88NY-0001eO-Vh for pgsql-general@lists.postgresql.org; Mon, 16 Apr 2018 17:57:25 +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 1f88NV-0000WK-Rc for pgsql-general@lists.postgresql.org; Mon, 16 Apr 2018 17:57:23 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E5761211A2; Mon, 16 Apr 2018 13:57:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 16 Apr 2018 13:57:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc: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=iZvpmW6x8fiD9eUdv/aFTOj3QuIad VdHZSqMbk5iClM=; b=D2/FK1rHuSgqLqfZO+IMpHLF/ngvShXok6DjVV8xRNsHG VS6PHobITDnNFQzjdf7toA4WxHzzYScTRFfTg92qprMYmloirarLLuwe9IswVBaB /LLBLebDmGBLH/yrWGYp3+vvXM8ooFWsgPmxEi3QxYKTe/K/KEygZ75KIOENiMTD 3v04a8DUs1KSH8u9KGzVbB9C59Z6MKxYqkFl/zMVYLlQLbIM3DAtKPVDsmYvM9M+ EPsvb0Glyl5D4utBDblRwQGNEA1+4hAAOrcsO1LRSJEeqEDYfJwdKEKyd9jh3Imy FH6k33lZCIW7ppb8u1unJSPMsc006hNAtH2KANv3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=iZvpmW 6x8fiD9eUdv/aFTOj3QuIadVdHZSqMbk5iClM=; b=kM2Z6zgpb4v+733t30s2wL +99TJlywgT3RXH9Wr1gdrmPCAgirn5KqID9I4+O5uoELAHtU1twyt/s9yklakH74 /tIEf+DZMeCWBax5FMbLCFEqohV/Vaz1fDbQlT2UHs+yuhFJv9pbtmqWuTJPET8F 2Y5KTjTqC4/6NfLxHIFvMZ15Fvep9F4oHUAx+Gb/6a/xEoLslZ24jxD48YEEbZiF z8CyTgps4u0Z8M2El2jfnT2Oisfm+dc0CWmwiY1ULheTtWx4Dx8tXm3/TH0QftMv UyOaRhXR/RQ1gYa3xvUnj2eE6CWpnqg4Htdl5omdneOGJnj1bt/PMo261x94v5ig == X-ME-Sender: Received: from [192.168.1.2] (71-35-123-124.tukw.qwest.net [71.35.123.124]) by mail.messagingengine.com (Postfix) with ESMTPA id 449A8E443C; Mon, 16 Apr 2018 13:57:20 -0400 (EDT) Subject: Re: client_encoding issue with SQL_ASCII on 8.3 to 10 upgrade To: Keith Fiske , Tom Lane Cc: pgsql-general@lists.postgresql.org References: <10581.1523894949@sss.pgh.pa.us> <11209.1523895708@sss.pgh.pa.us> From: Adrian Klaver Message-ID: <6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com> Date: Mon, 16 Apr 2018 10:57:19 -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: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/16/2018 10:18 AM, Keith Fiske wrote: > > > > So playing around with the "client_encoding" configuration option in > postgresql.conf. According to the docs, setting this should set the > default encoding for any client that connects, right? > > https://www.postgresql.org/docs/10/static/runtime-config-client.html#GUC-CLIENT-ENCODING > > > That description also seems misleading in saying that the default client > encoding is what the database encoding is as well. At least as far as > psql is concerned, right? I've tried setting that value in > postgresql.conf but psql keeps setting it to UTF8 when I connect to the > SQL_ASCII database unless I then specifically run "set client_encoding = > 'SQL_ASCII';" The order that parameters are evaluated for libpq programs is: https://www.postgresql.org/docs/10/static/libpq-connect.html "PQconnectdbParams ... If any parameter is NULL or an empty string, the corresponding environment variable (see Section 33.14) is checked. If the environment variable is not set either, then the indicated built-in defaults are used. ... " > > -- > Keith Fiske > Senior Database Engineer > Crunchy Data - http://crunchydata.com -- Adrian Klaver adrian.klaver@aklaver.com