我使用 UTF8 作为我的 Postgres 8.4.11 数据库的编码:
CREATE DATABASE test
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = mydata
LC_COLLATE = 'de_DE.UTF-8'
LC_CTYPE = 'de_DE.UTF-8'
CONNECTION LIMIT = -1;
ALTER DATABASE test SET default_tablespace='mydata';
ALTER DATABASE test SET temp_tablespaces=mydata;
和输出\l
test | postgres | UTF8 | de_DE.UTF-8 | de_DE.UTF-8 |
当我尝试插入德语字符时:
create table x(a text);
insert into x values('ä,ß,ö');
ERROR: invalid byte sequence for encoding "UTF8": 0xe42cdf HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
我正在使用腻子连接。任何想法?