Re: client encoding that psql command sets

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: Tsubasa Sakamoto *EXTERN* <sakamoto(dot)tsubasa(at)ryobi(dot)co(dot)jp>, 'Adrian Klaver' <adrian(dot)klaver(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: client encoding that psql command sets
Date: 2014-04-16 23:54:07
Message-ID: 20140416235407.GU7443@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Feb 7, 2014 at 09:12:10AM +0000, Albe Laurenz wrote:
> > Even when a LC_CTYPE environment variable was set up, the result did not change.
> > What do you think?
>
> I think that the documentation contradicts the code.
>
> In bin/psql/settings.h:
>
> typedef struct _psqlSettings
> {
> [...]
> bool notty; /* stdin or stdout is not a tty (as determined
> * on startup) */
> [...]
> } PsqlSettings;
>
> extern PsqlSettings pset;
>
> In bin/psql/command.c and bin/psql/startup.c:
>
> keywords[6] = "client_encoding";
> values[6] = (pset.notty || getenv("PGCLIENTENCODING")) ? NULL : "auto";
>
> That matches your observations: client_encoding=auto is only
> used if both stdin and stdout are attached to a tty.
>
> I suggest the attached documentation fix.

Patch applied and backpatched to 9.3. Thanks.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steven Schlansker 2014-04-16 23:58:23 Re: any way for a transaction to "see" inserts done earlier in the transaction?
Previous Message Susan Cassidy 2014-04-16 23:53:30 Re: any way for a transaction to "see" inserts done earlier in the transaction?

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-04-17 00:24:45 Re: Buildfarm "master-next" branch? (was: Dynamic Shared Memory stuff)
Previous Message Bruce Momjian 2014-04-16 23:48:06 Re: [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of < 0