换系统的时候图简单脑子抽抽了,直接 tar czf /var/lib/postgresql 。后解压放到新系统/var/lib 目录下,没有用 dump pgloader 之类的工具。现在所有的 database 一直报同一个错,不重建所有数据库可以解决吗? 报错如下,查询 geini/gpt3.5 无果,尝试ALTER DATABASE xxx REFRESH COLLATION VERSION;
显示 invalid collation version. 请问大佬们如何解决?
"2024-04-28 10:07:27.248 CST [3392] WARNING: database \"template1\" has no actual collation version, but a version was recorded", "2024-04-28 10:07:39.298 CST [3393] WARNING: database \"postgres\" has no actual collation version, but a version was recorded", "2024-04-28 10:07:49.150 CST [3398] WARNING: database \"vaultwarden\" has no actual collation version, but a version was recorded", "2024-04-28 10:07:49.150 CST [3399] WARNING: database \"vaultwarden\" has no actual collation version, but a version was recorded", "2024-04-28 10:07:51.323 CST [3400] WARNING: database \"vaultwarden\" has no actual collation version, but a version was recorded", "2024-04-28 10:08:03.244 CST [3401] WARNING: database \"miniflux\" has no actual collation version, but a version was recorded", "2024-04-28 10:08:15.275 CST [3402] WARNING: database \"core\" has no actual collation version, but a version was recorded",
1 dode 2024-04-28 10:36:34 +08:00 重新安装同版本 pg 数据库,修改数据目录权限,看看有没有表,数据 |
![]() | 2 mingwiki OP @dode #1 所有数据都在,表都在,但是每个查询都会出这么一天 warning 警告,虽然没啥大问题,但是这个报错消不掉。 |
![]() | 4 mingwiki OP @dode #3 10 几个库 我想偷个懒 哦对了原本系统是 arch ,新系统是 alpine 用的 musl libc ,可能底层不一样所以出错 |
![]() | 5 encro 2024-04-28 10:53:59 +08:00 看提示因为相应的校队规则不存在。去掉或者迁移过来。 |
![]() | 6 encro 2024-04-28 10:56:08 +08:00 ![]() 比如你数据库建库语句上指定了使用 template1 ,但是 template1 不存在,可能就会报这个错误。 |
![]() | 7 encro 2024-04-28 11:01:39 +08:00 |
![]() | 9 mingwiki OP @encro #7 这个我看到了也尝试过不起作用,template1 是模版数据库可以备份但是删不掉,所以还不能重建。报错如下 postgres=# ALTER DATABASE template1 REFRESH COLLATION VERSION; ERROR: invalid collation version change |
![]() | 10 retanoj 2024-04-28 11:11:23 +08:00 |
![]() | 11 encro 2024-04-28 11:13:59 +08:00 版本不对没法了,尝试重新恢复到原始状态,然后走导出导入吧。 ai 告诉我们如果是 icu 或者 glibc 更新导致的。可能就没辙了。 |
![]() | 12 mingwiki OP @retanoj #10 看最后一句话 That's it again - just that this post has no happy end. If you have some approach to fix the collation error, let me know! ![]() |
![]() | 13 mingwiki OP @encro #11 我其他库都重建成功了,但是 postgres 和 template1 重建不了,要不我重装一下 pg ? |
14 cslive 2024-04-28 11:23:57 +08:00 小版本可以,大版本不行,必须迁移 |
![]() | 15 encro 2024-04-28 11:26:56 +08:00 @mingwiki 估计没用的,应该是 pg 版本不对了,内置 postgres 和 template1 变了,你重装现在的 pg 解决不了问题。 只能先重装一个原来的 pg ,然后导出,再导入新的 pg 环境,让 pg 系统帮你解决。不去修改 pg 核心,才是比较稳妥的。 |