zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

Oracle 数据库sql语句查看字符集,PG数据库查询字符集方法

2023-03-20 15:36:18 时间

【Oracle 数据库查询字符集】 查询出 NLS_NCHAR_CHARACTERSET 参数的值即是数据库的字符集。

select * from nls_database_parameters;

【PG 数据库查询字符集】 正常从 pg_database 查出来的 encoding 是数字 6,通过 pg_encoding_to_char() 函数可以将数字 6 转化为代表的编码 UTF8

select pg_encoding_to_char(encoding) from pg_database where datname = '数据库名';