Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> As you can see, the result of "show client_encoding;" and "select
> pg_client_encoding();" do not match.
Weird, it works fine for me:
$ PGCLIENTENCODING=SJIS psql regression
Welcome to psql 7.4devel, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands
\g or terminate with semicolon to execute query \q to quit
regression=# \encoding
SJIS
regression=# show client_encoding;client_encoding
-----------------SJIS
(1 row)
regression=# select pg_client_encoding();pg_client_encoding
--------------------SJIS
(1 row)
I would not have been real surprised to hear that psql's \encoding is
out of sync, but it *does* surprise me that "show client_encoding" might
not match pg_client_encoding(). I would think those are looking at the
same backend state variable. Any theory how that could happen?
regards, tom lane