設置 | 登錄 | 註冊

目前共有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許可協議進行許可。