目前共有2篇帖子。 字体大小:较小 - 100% (默认)▼  内容转换:不转换▼
 
点击 回复
22 1
createdb失败,database "postgres" has a collation version mismatch
一派掌门 二十级
1楼 发表于:2025-9-4 10:22
bash-5.2$ createdb arsad
Password:
WARNING:  database "postgres" has a collation version mismatch
DETAIL:  The database was created using collation version 2.38, but the operating system provides version 2.41.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
createdb: error: database creation failed: ERROR:  template database "template1" has a collation version mismatch
DETAIL:  The template database was created using collation version 2.38, but the operating system provides version 2.41.
HINT:  Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
bash-5.2$
一派掌门 二十级
2楼 发表于:2025-9-4 10:24

解决办法:

psql

\c postgres

reindex database postgres;

alter database postgres refresh collation version;

\c template1

reindex database template1;

alter database template1 refresh collation version;

quit


参考资料:

https://blog.csdn.net/weixin_39132497/article/details/136120631

 

回复帖子

内容:
用户名: 您目前是匿名发表
验证码:
(快捷键:Ctrl+Enter)
 

本帖信息

点击数:22 回复数:1
评论数: ?
作者:巨大八爪鱼
最后回复:巨大八爪鱼
最后回复时间:2025-9-4 10:24
 
©2010-2025 Purasbar Ver2.0
除非另有声明,本站采用知识共享署名-相同方式共享 3.0 Unported许可协议进行许可。