在
Windows 7平台上,使用Postgresql版本9.3.9,使用PgAdmin作为客户端,在包含例如的列上选择上部的结果“ÿÿÿ”,返回null.如果存储三个值,例如,
"ada" "john" "mole" "ÿÿÿ"
除了包含“ÿÿÿ”的行外,它们都以大写形式返回;这一行
什么都没有回来,null …
数据库编码方案是UTF8 / UNICODE.设置“client_encoding”具有相同的值UNICODE.
这是数据库中的设置问题,操作系统问题还是错误
在数据库中?是否有一些推荐的解决方法?
的结果:
select thecol,upper(thecol),upper(thecol) is null,convert_to(thecol,'UTF8'),current_setting('server_encoding') from thetable where ...
是:
"Apps";"APPS";f;"Apps";"UTF8" "All";"ALL";f;"All";"UTF8" "Test";"TEST";f;"Test";"UTF8" "ÿÿÿ";"";f;"\303\277\303\277\303\277";"UTF8"
pg_settings的lc_部分是:
"lc_collate";"Swedish_Sweden.1252";"Shows the collation order locale." "lc_ctype";"Swedish_Sweden.1252";"Shows the character classification and case conversion locale." "lc_messages";"Swedish_Sweden.1252";"Sets the language in which messages are displayed." "lc_monetary";"Swedish_Sweden.1252";"Sets the locale for formatting monetary amounts." "lc_numeric";"Swedish_Sweden.1252";"Sets the locale for formatting numbers."
select * from pg_database的输出是:
"template1";10;6;"Swedish_Sweden.1252";"Swedish_Sweden.1252";t;t;-1;12130;668;1;1663;"{=c/postgres,postgres=CTc/postgres}" "template0";10;6;"Swedish_Sweden.1252";"Swedish_Sweden.1252";t;f;-1;12130;668;1;1663;"{=c/postgres,postgres=CTc/postgres}" "postgres";10;6;"Swedish_Sweden.1252";"Swedish_Sweden.1252";f;t;-1;12130;668;1;1663;""
对于9.4.4版本,实际的create database语句是:
CREATE DATABASE postgres WITH OWNER = postgres ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'Swedish_Sweden.1252' LC_CTYPE = 'Swedish_Sweden.1252' CONNECTION LIMIT = -1;
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。