SQL ERROR [22023]: ERROR: new collation is incompatible with the collation of the template database (English_United States.1252)

重现步骤

执行下面 SQL:

-- LC_COLLATE:string sort order
-- LC_CTYPE:character classification
-- database_name,数据库名称
-- database_user,用户名
CREATE DATABASE {database_name} WITH OWNER = {database_user} ENCODING 'UTF8' LC_COLLATE = 'Chinese (Simplified)_China.936' LC_CTYPE = 'Chinese (Simplified)_China.936';

发生错误:

SQL Error [22023]: ERROR: new collation (Chinese (Simplified)_China.936) is incompatible with the collation of the template database (English_United States.1252)
Hint: Use the same collation as in the template database, or use template0 as template.

解决方案

-- LC_COLLATE:string sort order
-- LC_CTYPE:character classification
-- database_name,数据库名称
-- database_user,用户名
CREATE DATABASE {database_name} WITH OWNER = {database_user} ENCODING 'UTF8' LC_COLLATE = 'Chinese (Simplified)_China.936' LC_CTYPE = 'Chinese (Simplified)_China.936' TEMPLATE template0;

参考

猜你喜欢

转载自www.cnblogs.com/nehcdahc/p/12448265.html