ubuntu改变区域后对Postgresql的影响
来源:互联网 发布:华为软件官网 编辑:程序博客网 时间:2024/05/23 15:11
没改变之前区域显示
ubuntu@vm172-31-0-9:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
数据库显示
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
Harvest | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
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
testdb | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
中文数据库显示
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-----------------------------------------------------+-----------------------------------------------------+-----------------------
Harvest | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 |
postgres | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 |
template0 | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 | =c/postgres +
| | | | | postgres=CTc/postgres
testdb | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 |
(5 rows)
vim /var/lib/locales/supported.d/local
添加
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8
使生效
sudo dpkg-reconfigure --force locales
然后重新生成locale
$sudo locale-gen
期间还安装了三个包
支持中文装三个包
sudo apt-get install language-selector language-env language-pack-zh
但发现不能用,最后执行下面这个指令
sudo apt-get install language-pack-zh-hant language-pack-zh-hans language-selector-gnome
新建一个目录data1
sudo mkdir /usr/local/pgsql/data1
sudo chown postgres /usr/local/pgsql/data1
export PATH=/usr/local/pgsql/bin/:$PATH
export PGDATA=/usr/local/pgsql/data1
初始化数据库
initdb
再看数据库,变成zh_CN.UTF-8
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
harvest | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
harvest1 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
postgres | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
template0 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
ubuntu@vm172-31-0-9:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
数据库显示
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
Harvest | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
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
testdb | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
中文数据库显示
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-----------------------------------------------------+-----------------------------------------------------+-----------------------
Harvest | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 |
postgres | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 |
template0 | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 | =c/postgres +
| | | | | postgres=CTc/postgres
testdb | postgres | UTF8 | Chinese (Simplified)_People's Republic of China.936 | Chinese (Simplified)_People's Republic of China.936 |
(5 rows)
vim /var/lib/locales/supported.d/local
添加
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8
使生效
sudo dpkg-reconfigure --force locales
然后重新生成locale
$sudo locale-gen
期间还安装了三个包
支持中文装三个包
sudo apt-get install language-selector language-env language-pack-zh
但发现不能用,最后执行下面这个指令
sudo apt-get install language-pack-zh-hant language-pack-zh-hans language-selector-gnome
新建一个目录data1
sudo mkdir /usr/local/pgsql/data1
sudo chown postgres /usr/local/pgsql/data1
export PATH=/usr/local/pgsql/bin/:$PATH
export PGDATA=/usr/local/pgsql/data1
初始化数据库
initdb
再看数据库,变成zh_CN.UTF-8
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
harvest | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
harvest1 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
postgres | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
template0 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
0 0
- ubuntu改变区域后对Postgresql的影响
- POSTGRESQL区域设置对索引和排序的影响
- PCip改变后对socket的影响
- iOS 仿射变换改变后对fram的影响
- 改变vector对iterator的影响
- XP[区域和语言选项]对环境配置的影响
- 引入线程后 对系统的影响
- 弹出软键盘对Listview效果影响的改变~~重要!
- 页面大小改变对idangerous swiper的影响
- 改变损失函数对模型和训练结果的影响
- 三峡建后对地区气候的影响
- 启用FRA后对RMAN备份路径的影响
- 感受吧 现在做什么 对十年后的影响
- iOS 开启热点后对状态栏的影响
- 开启MySQL performance_schema后对性能的影响
- 对windows区域(Region)的操作,不受SetWindowExtEx和SetViewportExtEx的影响
- postgresql中参数logging_collector对数据库系统启动日志和操作日志信息目的地的影响
- 优秀课件笔记之旅游发展对区域的影响Impact of Tourism Development
- firewall常用操作
- 算法作业_15(2017.4.15第八周)
- HFSS天线设计
- LeetCode:Odd Even Linked List
- Spring Cloud——断路器监控Hystrix Dashboard&Turbine
- ubuntu改变区域后对Postgresql的影响
- matlab常用快捷键
- pat 1120. Friend Numbers
- OpenCV实现基本灰度变换
- the diary for redirection in linux
- java设计模式--组合
- doGet与doPost的区别
- MySql分区类型以及建分区语句
- 南阳理工ACM 题目57 6174问题