The following bug has been logged online:
Bug reference: 6288
Logged by: Maksym Boguk
Email address: maxim.boguk@gmail.com
PostgreSQL version: 9.1
Operating system: Linux Ubuntu
Description: Is ALTER ROLE set client_encoding broken in 9.1?
Details:
I found common way deal with legacy applications encoding issues through
ALTER ROLE ... set client_encoding '...';
Doesn't work at 9.1 database:
test:
postgres@db13:/home/mboguk$ psql
psql (9.1.1)
Type "help" for help.
postgres=# CREATE DATABASE test WITH TEMPLATE = template0 ENCODING='KOI8R'
LC_COLLATE = 'ru_RU.KOI8-R' LC_CTYPE = 'ru_RU.KOI8-R';
CREATE DATABASE
postgres=# create role test with login;
CREATE ROLE
postgres=# alter role test set client_encoding to 'KOI8R';
ALTER ROLE
postgres=# \q
postgres@db13:/home/mboguk$ psql -U test
psql (9.1.1)
Type "help" for help.
test=> show client_encoding ;
client_encoding
-----------------
UTF8
(1 row)
The same way work without any issues with 8.3 and 8.4.
PS: it's possible i'm missing something obvious.