目前共有2篇帖子。 字體大小:較小 - 100% (默認)▼  內容轉換:不轉換▼
 
點擊 回復
17 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)
 

本帖信息

點擊數:17 回複數:1
評論數: ?
作者:巨大八爪鱼
最後回復:巨大八爪鱼
最後回復時間:2025-9-4 10:24
 
©2010-2025 Purasbar Ver2.0
除非另有聲明,本站採用創用CC姓名標示-相同方式分享 3.0 Unported許可協議進行許可。