检查DB是否是使用unicode开发的

Pra*_*nya 0 postgresql unicode

我们如何检查数据库是否是unicode。我正在使用 postgresql,我需要知道它是否是 unicode。

谢谢

Cra*_*ger 5

不存在“使用”unicode 开发的情况。

如果您想知道数据库编码,请使用:

SELECT current_setting('server_encoding');
Run Code Online (Sandbox Code Playgroud)

它报告当前数据库的数据库编码。或者为任何数据库获取它:

select pg_catalog.pg_encoding_to_char(d.encoding) 
from pg_database d
where datname = 'mydatabase';
Run Code Online (Sandbox Code Playgroud)

您可能还对排序规则感兴趣,请参阅psql\l输出以了解详细信息,并查看生成它的查询psql -E然后运行\l