SQLSHELL。 client_encoding 显示不正确 'UTF8' 或 'WIN1252'

SQL SHELL. client_encoding not displaying properly 'UTF8' or 'WIN1252'

当我使用 'UTF8' 时,它是奇怪的字符

postgres=# set client_encoding to 'UTF8';

postgres=# insert into workingon(2,1,150);

DzD"D~D`DsD?:  D_Ñ^D,D±DºD° Ñ?D,D½Ñ,D°DºÑ?D,Ñ?D° (D¿Ñ?D,D¼DµÑ?D½D_Dµ D¿D_D»D_DDµD½D,Dµ: "2")
LINE 1: insert into workingon(2,1,150);

当我使用 'WIN1252' 时它不起作用

postgres=# set client_encoding to 'WIN1252';

SET

postgres=# insert into workingon(2,1,150);

ERROR:  character with byte sequence 0xd0 0x9e in encoding "UTF8" has no equivalent in encoding "WIN1252"

尝试设置 lc_messages = C,以便以可以在 WIN1252 中编码的语言显示错误消息。

您最好更改 postgresql.conf 中的设置并重新加载。此设置还会影响日志文件的语言,如果您想在网上搜索错误消息,英语是最佳选择。