pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6288: Is ALTER ROLE set client_encoding broken in 9.1?
Date: Fri, 11 Nov 2011 15:34:39 -0500
Message-ID: <10708.1321043679@sss.pgh.pa.us> (raw)
In-Reply-To: <1321030104.14677.2.camel@vanquo.pezone.net>
References: <201111101109.pAAB9Vja074963@wwwmaster.postgresql.org>
	<7531.1320936943@sss.pgh.pa.us>
	<CAK-MWwRUf0fPL8NxkZVBdJYd_bUWz7QO7gQV3Bb1N6iypm-2KQ@mail.gmail.com>
	<20758.1320971432@sss.pgh.pa.us>
	<1321030104.14677.2.camel@vanquo.pezone.net>

Peter Eisentraut <peter_e@gmx.net> writes:
> On tor, 2011-11-10 at 19:30 -0500, Tom Lane wrote:
>> I think psql only pays attention to its locale when stdout is a tty.
>> Now *why* it acts like that, I'll leave for Peter to defend.

> We would have to review the original discussion about that.  I can see
> arguments for doing it that way and for not doing it that way.

> This, however, still doesn't explain why a ALTER ROLE ... SET
> client_encoding is not taking effect.  After all, a plain SET
> client_encoding still works.

The ALTER ROLE *does* take effect ... and then psql overrides it from
the environment.  Not sure why you expected differently --- psql doesn't
especially care why the server sent the initial client_encoding that it
did.

BTW, I noticed while experimenting with this that if I have an
environment of LANG="C", psql overrides the client_encoding to be
SQL_ASCII, regardless of what the database encoding is.  This seems
like a bad idea, since it removes knowledge rather than adding any.

			regards, tom lane



view thread (6+ messages)

Message-ID: <10708.1321043679@sss.pgh.pa.us>
Permalink:  ../10708.1321043679@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10708.1321043679@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, maxim.boguk@gmail.com
  Subject: Re: BUG #6288: Is ALTER ROLE set client_encoding broken in 9.1?
  In-Reply-To: <10708.1321043679@sss.pgh.pa.us>
  References: <201111101109.pAAB9Vja074963@wwwmaster.postgresql.org> <7531.1320936943@sss.pgh.pa.us> <CAK-MWwRUf0fPL8NxkZVBdJYd_bUWz7QO7gQV3Bb1N6iypm-2KQ@mail.gmail.com> <20758.1320971432@sss.pgh.pa.us> <1321030104.14677.2.camel@vanquo.pezone.net> <10708.1321043679@sss.pgh.pa.us>

* 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