Re: client encoding that psql command sets - Mailing list pgsql-general

From Bruce Momjian
Subject Re: client encoding that psql command sets
Date
Msg-id 20140416235407.GU7443@momjian.us
Whole thread Raw
In response to Re: client encoding that psql command sets  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-general
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@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


pgsql-general by date:

Previous
From: Susan Cassidy
Date:
Subject: Re: any way for a transaction to "see" inserts done earlier in the transaction?
Next
From: Steven Schlansker
Date:
Subject: Re: any way for a transaction to "see" inserts done earlier in the transaction?