PostgreSQL数据库迁移到其他主机
我试图将我的Postgres DB从一个主机(Xenial)移至另一个主机(焦点)。我已经尝试使用pgdump为此,
pg_dump -d mydb > backup.sql
但是问题是,在我在新主机上恢复DB之后,
psql -d mydb < backup.sql
我会在日志上遇到一个错误:“您的整理似乎有更改:重建索引,然后清空表Access_db_check”。我没有问题,但是我想弄清楚导致整理的变化是什么。 新主机上的db都具有| utf8 | en_us.utf-8 | en_us.utf-8用于编码| callate | ctype。也许是因为版本差异?旧的是12.7-1,而新的是12.9
Im trying to move my postgres db from one host (xenial) to another (focal). I've tried using pgdump for it
pg_dump -d mydb > backup.sql
But the problem is that after I've restored db on my new host with
psql -d mydb < backup.sql
I get an error in logs: "Your collation seems to have change: rebuild your index then empty the table access_db_check". I have no problem doing that but I want to figure out what causing collation to change.
DB on new and old host both have |UTF8|en_US.UTF-8|en_US.UTF-8 for encoding|Collate|Ctype. Maybe it's because of version difference? Old on is 12.7-1 and new one is 12.9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以确认源和目标Postgres版本是否相同。
如果是,您可以检查源数据库和目标数据库的整理是否相同。通常,应该是“ UTF-8”
以下命令可能会为您提供帮助。
从pg_database选择datcollate,其中datname ='&lt; database name&gt;';
Can you confirm if the source and destination postgres versions are same.
If yes, can you check if the collation of your source database and destination database is same. Mostly it should be "UTF-8"
The below command might help you.
SELECT datcollate FROM pg_database WHERE datname='<database name>';