Re: minor changes in psql's \encoding command

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: minor changes in psql's \encoding command
Дата
Msg-id 6596.1041743824@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: minor changes in psql's \encoding command  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: minor changes in psql's \encoding command  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
I said:
> I'd prefer to just document that PQclientEncoding is untrustworthy if
> the client sets the encoding directly (rather than via PGCLIENTENCODING
> or PQsetClientEncoding), and similarly that psql's \encoding is not
> trustworthy if one goes behind its back.

On looking closer, both libpq and psql assume that their current
internal encoding settings accurately describe the strings they get
from the backend.  So hacking up PQclientEncoding() wouldn't be enough
to fix all the problems anyway.

I think we need to document that doing "SET client_encoding" directly is
hazardous to your health with either of these interfaces, and perhaps
with others as well.  Anyone know how JDBC and ODBC deal with encoding?

            regards, tom lane

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

Предыдущее
От: Weiping He
Дата:
Сообщение: Re: minor changes in psql's \encoding command
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: minor changes in psql's \encoding command