天天看点

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

【Oracle 数据库查询字符集】

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

select * from nls_database_parameters;      
Oracle 数据库sql语句查看字符集,PG数据库查询字符集方法

【PG 数据库查询字符集】

正常从 pg_database 查出来的 encoding 是数字 6,通过 pg_encoding_to_char() 函数可以将数字 6 转化为代表的编码 UTF8。

select pg_encoding_to_char(encoding) from pg_database where datname = '数据库名';      
Oracle 数据库sql语句查看字符集,PG数据库查询字符集方法

喜欢的点个赞❤吧!