A client and server encoding question

Поиск
Список
Период
Сортировка
От Amit Langote
Тема A client and server encoding question
Дата
Msg-id CA+HiwqGDYcgmxp4D9J4MhojmZod0-+xZ2XW4A8XcdV=3ehH6+g@mail.gmail.com
обсуждение исходный текст
Ответы Re: A client and server encoding question  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: pg_dumpall from a script
Следующее
От: Luca Ferrari
Дата:
Сообщение: Re: how to get the connected session pointer ( Archive * AH)