Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com> writes:
> However personally I'm think this behavior is rather non-intuitive:
> postgres(at)db13:~$ psql -U slony -d test -c 'show client_encoding'
> client_encoding
> -----------------
> UTF8
> (1 row)
> postgres(at)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