Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2CDEE12ACC82 for ; Thu, 10 Nov 2011 20:30:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 35649-04 for ; Fri, 11 Nov 2011 00:30:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2A7DB12ACC81 for ; Thu, 10 Nov 2011 20:30:35 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pAB0UW73020759; Thu, 10 Nov 2011 19:30:32 -0500 (EST) To: Maxim Boguk cc: pgsql-bugs@postgresql.org, Peter Eisentraut Subject: Re: BUG #6288: Is ALTER ROLE set client_encoding broken in 9.1? In-reply-to: References: <201111101109.pAAB9Vja074963@wwwmaster.postgresql.org> <7531.1320936943@sss.pgh.pa.us> Comments: In-reply-to Maxim Boguk message dated "Fri, 11 Nov 2011 10:17:05 +1100" Date: Thu, 10 Nov 2011 19:30:32 -0500 Message-ID: <20758.1320971432@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/83 X-Sequence-Number: 31678 Maxim Boguk writes: > However personally I'm think this behavior is rather non-intuitive: > postgres@db13:~$ psql -U slony -d test -c 'show client_encoding' > client_encoding > ----------------- > UTF8 > (1 row) > postgres@db13:~$ psql -U slony -d test -c 'show client_encoding' | head -10 > client_encoding > ----------------- > KOI8R > (1 row) 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. regards, tom lane