必须是扩展plpgsql的所有者

必须是扩展plpgsql的所有者

本文介绍了使用pg:backups从本地数据库还原Heroku,并带有“错误:必须是扩展plpgsql的所有者";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经在此处此处,但我没有任何合作的希望.

The problem has already been approached here and here but without any outcome for me to work with.

我正在按照Heroku文档中的要求进行备份.

I am backing up using as required in the Heroku documentation.

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

当我这样还原时(文件大小为〜100MB):

When I restore like so (the file's size is ~100MB):

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

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

I receive an error message after the progress of uploading stops at 19.4MB and logs state:

$ 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 MB.

I first thought it could be due to the table file which contains BLOBS. But I can't seem to understand why it should be a problem. The largest file is 4MB.The logs also state that only 19.4 of the 100MB have been imported.

我使用以下版本的heroku工具带:

I use the following version of the 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
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
heroku-pg-extras
[email protected]
[email protected]
[email protected]
[email protected]

推荐答案

我想我的数据库计划不足以支持该操作.我可以在heroku 常见问题解答

I suppose my database plan was not big enough to support the operation. I can exclude the other issues statet in the heroku FAQ

这篇关于使用pg:backups从本地数据库还原Heroku,并带有“错误:必须是扩展plpgsql的所有者";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 04:15