19cOCP 6月周末班 正在授课 欢迎试听         RHCE9 6月周末班 正在授课 欢迎试学         PGCE 认证专家,周末班报名中,欢迎垂询         数据库运维工程师招聘         RHCE认证培训钜惠学习         OCP认证培训组团活动特惠中!!!         MySQL认证周末班 正在招生 欢迎垂询!         

如何查看PG字符集

更新时间: 2024-05-07 01:08

show 查看客户端和服务器实例的字符集
 
1.查看数据字符集编码
 
数据库的字符集存储在系统目录pg_database中
 
psql -l
 
或者
 
postgres=# \l
 
List of databases
 
Name | Owner | Encoding | Collate | Ctype | Access privileges
 
-------------+----------+----------+-------------+-------------+-----------------------
 
db3 | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
db4 | role1 | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
db5 | role2 | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
dbtemplate | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
dbtemplate1 | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
dbtemplate2 | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
korean | postgres | EUC_KR | ko_KR.euckr | ko_KR.euckr |
 
postgres | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
template0 | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 | =c/postgres +
 
| | | | | postgres=CTc/postgres
 
template1 | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 | =c/postgres +
 
| | | | | postgres=CTc/postgres
 
testdb | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 |
 
(11 rows)
 
2.查看服务端字符集
 
postgres=# show server_encoding;
 
server_encoding
 
-----------------
 
UTF8
 
(1 row)
 
3.查看客户端字符集
 
postgres=# show client_encoding;
 
client_encoding
 
-----------------
 
UTF8
 
(1 row)
 
postgres=#
 
4.查看默认的排序规则和字符分类
 
字符分类
 
postgres=# show lc_ctype;
 
lc_ctype
 
------------
 
en_US.UTF8
 
(1 row)
 
排序规则
 
postgres=# show lc_collate;
 
lc_collate
 
------------
 
en_US.UTF8

PGCE认证专家培训钜惠

开班信息MORE>>

课程名称 开课时间 上课类型 状态
OCM培训 6月 周末班 授课中...
RHCE培训 6月 周末班 授课中...
OCP培训 6月 周末班 授课中...
PGCE 数据库认证专家 6月 周末班 报名中...
OCP培训 7月 精英班 报名中...
RHCE培训 常年 周末班 报名中...
MySQL培训 常年 周末班 报名中...
<<