设置 | 登录 | 注册

目前共有2篇帖子。

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

内容转换:

回复帖子
内容:
用户名: 您目前是匿名发表。
验证码:
看不清?换一张
©2010-2025 Purasbar Ver3.0 [手机版] [桌面版]
除非另有声明,本站采用知识共享署名-相同方式共享 3.0 Unported许可协议进行许可。