Hi,
With a server initdb'd with UTF8 encoding , if I create a table with a
client using LATIN1 encoding and later try to work with the relation
with a client using UTF8 encoding (both the scenarios simulated using
single session of psql but with different client_encoding set), there
is an error. Following might help illustrate the problem:
psql (9.2.4)
Type "help" for help.
postgres=# SHOW server_encoding;
server_encoding
-----------------
UTF8
(1 row)
Time: 0.761 ms
postgres=# SET client_encoding TO LATIN1;
SET
Time: 1.382 ms
postgres=# create table id_äß(ID int);
CREATE TABLE
Time: 31.344 ms
postgres=# \dt
List of relations
Schema | Name | Type | Owner
--------+---------+-------+-------
public | id_äß | table | amit
(1 row)
postgres=# SET client_encoding TO UTF8;
SET
Time: 1.007 ms
postgres=# \dt
List of relations
Schema | Name | Type | Owner
--------+--------------+-------+-------
public | id_äÃ\u009F | table | amit
(1 row)
postgres=# drop table id_äß;
ERROR: table "id_äß" does not exist
Time: 1.668 ms
postgres=# SET client_encoding TO LATIN1;
SET
Time: 0.745 ms
postgres=# drop table id_äß;
DROP TABLE
Time: 16.954 ms
But, I had an impression that above shouldn't have caused any problem?
Should UTF8 handle the situation gracefully? Or am I missing
something?
--
Amit Langote