There are currently 2 posts.
Font size: Small - 100% (Default)  Content converter: No conversion
 
Clicks Replies
924 1
createdb失败,database "postgres" has a collation version mismatch
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 1 Posted at: 9/4/25 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$
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 2 Posted at: 9/4/25 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

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
(Shortcut key: Ctrl+Enter)
Post Information
Clicks: 924 Replies: 1
Author: 巨大八爪鱼
Last reply: 巨大八爪鱼
Last reply time: 9/4/25 10:24
Announcements