微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

hstore 错误使用 pg_restore 恢复 postgres怎么修?

如何解决hstore 错误使用 pg_restore 恢复 postgres怎么修?

我在 ubuntu 服务器上有一个 postgres 数据库psql --version输出psql (Postgresql) 10.15 (Ubuntu 10.15-0ubuntu0.18.04.1)。我使用命令创建了这个数据库的转储

pg_dump -U curIoUslearn -h localhost -p 5432 -Fc -f mydb.dump mydb

然后我将文件复制到我的本地机器(运行 Mac OSX)并具有 postgres 版本 psql (Postgresql) 13.2

我尝试使用以下命令序列将数据库恢复为不同的名称

  1. 我使用 createdb mydbtest 创建数据库
  2. 然后,我使用 psql -d mydbtest 连接到数据库
  3. 我运行 DROP SCHEMA IF EXISTS PUBLIC;(如果我不这样做,我会收到一条错误消息,指出架构 public 已经存在)。
  4. 我运行命令: pg_restore --no-owner --no-privileges -d mydbtest mydb.dump

我的问题是出现以下错误。你能建议如何修复它们吗?谢谢你。我搜索了很多,但 "$libdir/hstore" 的结果并不多。没有什么是有帮助的。如果你能想到一些事情,我可以尝试。谢谢。

pg_restore: from TOC entry 2; 3079 18199 EXTENSION hstore
pg_restore: error: Could not execute query: ERROR:  Could not access file "$libdir/hstore": No such file or directory
Command was: CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;


pg_restore: from TOC entry 3061; 0 0 COMMENT EXTENSION hstore
pg_restore: error: Could not execute query: ERROR:  extension "hstore" does not exist
Command was: COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key,value) pairs';

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。