postgre 修改数据库 默认编码

1、查看编码
select * from pg_database
2、修改编码
update pg_database set encoding = pg_char_to_encoding(‘UTF8’) where datname = ‘template1’
3、显示编码
show server_encoding
Show client_encoding
4、查看编码
select name,setting,context from pg_settings where name like ‘%encoding%’;
5、设置客户端编码
set client_encoding to ‘utf8’;

发布了85 篇原创文章 · 获赞 7 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/guoruijun_2012_4/article/details/103898749
今日推荐