pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Keith Fiske <keith.fiske@crunchydata.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: client_encoding issue with SQL_ASCII on 8.3 to 10 upgrade
Date: Mon, 16 Apr 2018 10:57:19 -0700
Message-ID: <6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com> (raw)
In-Reply-To: <CAODZiv65fgA9jcOk0BcZDQXgrRmpKWb2AHnpq7LAvz9jGksB5A@mail.gmail.com>
References: <CAODZiv7K+AaJSPk=uqmNa7UQ2va7z_1d_KgVeZzEeqDNvgBn9g@mail.gmail.com>
	<10581.1523894949@sss.pgh.pa.us>
	<CAODZiv75hfwLbfH0BWKFdq6c5M5NjyhB+oexLWPDvpJuwBLmeg@mail.gmail.com>
	<11209.1523895708@sss.pgh.pa.us>
	<CAODZiv65fgA9jcOk0BcZDQXgrRmpKWb2AHnpq7LAvz9jGksB5A@mail.gmail.com>

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 
> <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




view thread (14+ messages)  latest in thread

Message-ID: <6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com>
Permalink:  ../6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com/
Also on:    postgresql.org/message-id/6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, keith.fiske@crunchydata.com, tgl@sss.pgh.pa.us
  Subject: Re: client_encoding issue with SQL_ASCII on 8.3 to 10 upgrade
  In-Reply-To: <6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com>
  References: <CAODZiv7K+AaJSPk=uqmNa7UQ2va7z_1d_KgVeZzEeqDNvgBn9g@mail.gmail.com> <10581.1523894949@sss.pgh.pa.us> <CAODZiv75hfwLbfH0BWKFdq6c5M5NjyhB+oexLWPDvpJuwBLmeg@mail.gmail.com> <11209.1523895708@sss.pgh.pa.us> <CAODZiv65fgA9jcOk0BcZDQXgrRmpKWb2AHnpq7LAvz9jGksB5A@mail.gmail.com> <6cd19ec1-8f1f-c2a8-6c9c-76c230cdcf51@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox