【问题标题】:postgres - cannot create collationpostgres - 无法创建排序规则
【发布时间】:2013-10-23 16:01:56
【问题描述】:

我有一个在 debian wheezy 上运行的 postgres 9.2 数据库。如果我在 pgadmin 中执行:

CREATE COLLATION en ( LOCALE = 'en_US.UTF-8')

我收到以下错误消息。

ERROR:  could not create locale "en_US.UTF-8": Datei oder Verzeichnis nicht gefunden
DETAIL:  The operating system could not find any locale data for the locale name "en_US.UTF-8".

我已经在那台机器上配置了本地并重新启动了 postgres:

locale-gen en_US.UTF-8
Generating locales (this might take a while)...
  de_DE.UTF-8... done
  en_US.UTF-8... done
  fr_FR.UTF-8... done
  tr_TR.UTF-8... done

但错误仍然存​​在。还有什么我需要检查的吗?

【问题讨论】:

  • 你可能需要重启postgres服务

标签: postgresql debian locale collation


【解决方案1】:

您的基本问题是 PostgreSQL 使用操作系统区域设置和排序规则。

在 Debian 上,您需要运行以下命令来添加语言环境:

dpkg-reconfigure locales

然后,一旦 en_US.UTF-8 存在,它应该可以工作。

【讨论】:

    猜你喜欢
    • 2013-03-18
    • 2011-05-17
    • 1970-01-01
    • 2021-12-03
    • 1970-01-01
    • 2015-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多