温馨提示×

怎么在postgresql中为数据库指定编码

养鱼的猫咪
816
2021-05-07 17:39:10
栏目: 云计算

在postgresql中为数据库指定编码的方法:1.启动postgresql服务;2.登录postgresql数据库;3.执行命令创建数据库并指定编码;

怎么在postgresql中为数据库指定编码

具体步骤如下:

1.首先,在命令行中启动postgresql服务;

net start postgresql

2.postgresql服务启动后,在命令行中登录到postgresql数据库;

psql -h -U

3.登录到postgresql数据库后,在postgresql中执行以下命令新建数据库并指定编码;

#新建一个text库并指定为UTF-8编码

createdb -E UTF8 text

相关命令扩展:

1)查看数据库编码

show client_encoding;

2)修改数据库编码

#修改数据库编码为GBK

set client_encoding='GBK';

0