加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

在postgreSQL中为utf-8的LC_COLLATE和LC_CTYPE支持

发布时间:2020-12-13 16:38:30 所属栏目:百科 来源:网络整理
导读:从这个链接 http://wiki.postgresql.org/wiki/Todo:Collate和 http://www.postgresql.org/docs/9.1/static/collation.html.这让我很困惑。 他们表示,utf-8支持取决于操作系统的能力,以及它在每个LC_COLLATE和LC_CTYPE选项之间的差异。 当我使用pdAdmin III
从这个链接 http://wiki.postgresql.org/wiki/Todo:Collate和 http://www.postgresql.org/docs/9.1/static/collation.html.这让我很困惑。

他们表示,utf-8支持取决于操作系统的能力,以及它在每个LC_COLLATE和LC_CTYPE选项之间的差异。

当我使用pdAdmin III创建数据库时,有3个选项C,Posix和English_United States.1252。 C,Posix和English_United States之间的区别是什么?

我想要支持所有语言的工作,那就是unicode utf-8,这似乎不是一个选择。

为了在PostgreSQL 9中创建支持utf-8的数据库,我必须选择LC_COLLATE和LC_CTYPE的值?

作为文档, 22.2. Character Set Support说:

An important restriction,however,is
that each database’s character set
must be compatible with the database’s
LC_CTYPE (character classification)
and LC_COLLATE (string sort order)
locale settings. For C or POSIX
locale,any character set is allowed,
but for other locales there is only
one character set that will work
correctly. (On Windows,UTF-8
encoding can be used with any locale.)

我看到可能你在Windows主机(英语_United States.1252语言环境)下有PostgreSQL,所以你可以使用任何这些(Posix与C相同,意思是“no locale”),读取22.1. Locale Support:

Locale support refers to an
application respecting cultural
preferences regarding alphabets,
sorting,number formatting,etc.

If you want the system to behave as if
it had no locale support,use the
special locale C or POSIX.

编辑:

Windows平台不符合POSIX标准,因此您应该为该平台使用C语言环境。我不知道为什么安装程序有POSIX选项(我猜这是一个bug):

要创建没有区域设置的新集群,您可以简单地使用–no-locale开关,例如:

initdb --no-locale -E UTF-8 C:pgdata

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读