更改数据库排序规则,PostgreSQL中的Ctype [英] Change Database Collation, Ctype in Postgresql

查看:107
本文介绍了更改数据库排序规则,PostgreSQL中的Ctype的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将排序规则cType从 en_US.UTF-8

how do I change Collation, cType to - en_IN from en_US.UTF-8

                              List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             : postgres=CTc/postgres

我当前的postgresversion为8.4
ive使用

my current postgresversion is 8.4 ive installed it using

sudo apt-get install postgresql-8.4 postgresql-contrib-8.4

在我的Ubuntu服务器ec2中做到这一点

im doing this in my ubuntu amazon server ec2

推荐答案

我的建议:


  1. 参加pg_dumpall

  1. take a pg_dumpall

重新初始化数据库集群,确保语言环境信息正确

re-initialize the db cluster, making sure the locale information is correct

还原转储。

我发现有时可能需要创建一个带有template template0的数据库(-T template0 from bash或使用来自psql的TEMPLATE template0 来使用非init-db语言环境。

I have found that sometimes it is possible that one may have to create a db with template template0 (-T template0 from bash or WITH TEMPLATE template0 from psql) to use a non-init-db locale.

这篇关于更改数据库排序规则,PostgreSQL中的Ctype的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆