gpt4 book ai didi

postgresql - 如何从 Ninefold 导出 Heroku 友好的 Postgres 转储?

转载 作者:行者123 更新时间:2023-11-29 13:27:48 24 4
gpt4 key购买 nike

我正在尝试将我的 postgres 数据库从 ninefold 迁移到 heroku。

我用来导出的命令是:

PGPASSWORD=password pg_dump -h ipaddress -p port -U user -d database -Fc --no-acl --no-owner -x -O -N postgis > ninefold-backup.dump

然后上传到S3,然后运行这个命令:

heroku pg:backups restore 'https://s3-us-west-2.amazonaws.com/bucket/ninefold-backup.dump' DATABASE_URL -a app --confirm app

然后 heroku 报告:

An error occurred and your backup did not finish.

Please run `heroku pg:backups info r003` for details.

在日志中它显示如下错误:

2015-05-23 22:32:36 +0000: pg_restore: creating COMMENT EXTENSION xml2
2015-05-23 22:32:36 +0000: pg_restore: [archiver (db)] Error from TOC entry 5157; 0 0 COMMENT EXTENSION xml2
2015-05-23 22:32:36 +0000: pg_restore: [archiver (db)] could not execute query: ERROR: extension "xml2" does not exist
2015-05-23 22:32:36 +0000: Command was: COMMENT ON EXTENSION xml2 IS 'XPath querying and XSLT';

2015-05-23 22:32:36 +0000: pg_restore: processing data for table "spatial_ref_sys"
2015-05-23 22:32:36 +0000: pg_restore: [archiver (db)] Error from TOC entry 4958; 0 19010 TABLE DATA spatial_ref_sys postgres
2015-05-23 22:32:37 +0000: pg_restore: [archiver (db)] could not execute query: ERROR: relation "spatial_ref_sys" does not exist
2015-05-23 22:32:37 +0000: Command was: COPY spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) FROM stdin;

2015-05-23 22:07:39 +0000: pg_restore: processing data for table "topology"
2015-05-23 22:07:39 +0000: pg_restore: [archiver (db)] Error from TOC entry 4959; 0 20039 TABLE DATA topology postgres
2015-05-23 22:07:39 +0000: pg_restore: [archiver (db)] could not execute query: ERROR: relation "topology" does not exist
2015-05-23 22:07:39 +0000: Command was: COPY topology (id, name, srid, "precision", hasz) FROM stdin;

我错过了什么?

最佳答案

找到方法了。 Ninefold 使用的扩展似乎存在一些问题,因此通过添加 -n public 选项,它将仅创建公共(public)模式的备份。

PGPASSWORD=password pg_dump -h ipaddress -p port -U user -d database -Fc --no-acl --no-owner -x -O -N postgis -n public > ninefold-backup.dump

关于postgresql - 如何从 Ninefold 导出 Heroku 友好的 Postgres 转储?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30418110/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com