怎样让postgresql创建数据库时默认为UTF8编码
1个回答
2015-09-09 · 知道合伙人软件行家
关注
展开全部
postgres=# \h create database
Command: CREATE DATABASE
Description: create a new database
Syntax:
CREATE DATABASE name
[ [ WITH ] [ OWNER [=] user_name ]
[ TEMPLATE [=] template ]
[ ENCODING [=] encoding ]
[ LC_COLLATE [=] lc_collate ]
[ LC_CTYPE [=] lc_ctype ]
[ TABLESPACE [=] tablespace ]
[ CONNECTION LIMIT [=] connlimit ] ]
--一个例子,指定字符集
CREATE DATABASE wapreader
WITH OWNER = wapreader
TEMPLATE = template0
ENCODING = 'UTF8'
TABLESPACE = tbs_wapreader;
Command: CREATE DATABASE
Description: create a new database
Syntax:
CREATE DATABASE name
[ [ WITH ] [ OWNER [=] user_name ]
[ TEMPLATE [=] template ]
[ ENCODING [=] encoding ]
[ LC_COLLATE [=] lc_collate ]
[ LC_CTYPE [=] lc_ctype ]
[ TABLESPACE [=] tablespace ]
[ CONNECTION LIMIT [=] connlimit ] ]
--一个例子,指定字符集
CREATE DATABASE wapreader
WITH OWNER = wapreader
TEMPLATE = template0
ENCODING = 'UTF8'
TABLESPACE = tbs_wapreader;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询