Heroku从本地数据库恢复pg:backups with" ERROR:必须是扩展名plpgsql的所有者"

时间:2016-04-29 10:41:48

标签: postgresql heroku

问题已经接近herehere,但我没有任何结果可以使用。

我正在使用Heroku文档中的要求进行备份。

pg_dump -Fc --no-acl --no-owner --no-privileges  -h [HOST] -U [DB_USER] [DB_NAME] > backup.dump

当我像这样恢复时(文件的大小约为100MB):

heroku pg:backups --app [APP_NAME] restore 'https://[DUMP_URL]' [HEROKU_DATABASE_URL]

上传进度停止在19.4MB并记录状态后,收到错误消息:

$ heroku pg:backups --app [APP_NAME] info r081
=== Backup info: r081
Database:    BACKUP
Started:     2016-04-29 10:10:37 +0000
Finished:    2016-04-29 10:11:31 +0000
Status:      Failed
Type:        Manual
Backup Size: 19.4MB
=== Backup Logs
2016-04-29 10:10:39 +0000: pg_restore: connecting to database for restore
2016-04-29 10:10:41 +0000: pg_restore: creating SCHEMA public
2016-04-29 10:10:41 +0000: pg_restore: creating EXTENSION plpgsql
2016-04-29 10:10:41 +0000: pg_restore: creating COMMENT EXTENSION plpgsql
2016-04-29 10:10:41 +0000: pg_restore: [archiver (db)] Error while PROCESSING TOC:
2016-04-29 10:10:41 +0000: pg_restore: [archiver (db)] Error from TOC entry 2474; 0 0 COMMENT EXTENSION plpgsql
2016-04-29 10:10:41 +0000: pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql
2016-04-29 10:10:41 +0000: Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
2016-04-29 10:10:41 +0000: 
2016-04-29 10:10:41 +0000: 
2016-04-29 10:10:41 +0000: 
2016-04-29 10:10:41 +0000: pg_restore: creating SEQUENCE answer_seq
[...]
2016-04-29 10:10:48 +0000: pg_restore: executing SEQUENCE SET category_seq
2016-04-29 10:10:49 +0000: pg_restore: processing data for table "file"
2016-04-29 10:11:31 +0000: out of memory
2016-04-29 10:11:31 +0000: waiting for restore to complete
2016-04-29 10:11:31 +0000: restore done
2016-04-29 10:11:31 +0000: waiting for download to complete
2016-04-29 10:11:31 +0000: download done

我首先想到的可能是由于包含BLOBS的表文件。但我似乎无法理解为什么它应该是一个问题。最大的文件是4MB。 日志还说明100MB中只有19.4已经导入。

我使用以下版本的heroku toolbelt:

heroku-toolbelt/3.43.0 (x86_64-linux-gnu) ruby/2.1.5
heroku-cli/4.30.0-2dfc0f4 (amd64-linux) go1.6.2
=== Installed Plugins
heroku-apps@2.0.3
heroku-cli-addons@0.3.0
heroku-fork@4.1.3
heroku-git@2.5.1
heroku-local@5.0.2
heroku-orgs@1.1.0
heroku-pg-extras
heroku-pipelines@1.1.5
heroku-run@3.2.3
heroku-spaces@2.1.2
heroku-status@2.1.4

1 个答案:

答案 0 :(得分:0)

我想我的database plan was not big enough支持这项行动。我可以在heroku FAQ

中排除其他问题statet