PGError:错误:关系被拒绝(使用 Heroku 时) [英] PGError: ERROR: permission denied for relation (when using Heroku)
问题描述
我最近完成了此处概述的数据库迁移过程:
https://devcenter.heroku.com/文章/从共享数据库迁移到heroku-postgres
现在我在日志中看到了一些这样的错误:
PGError: ERROR: 权限被拒绝
关于我应该怎么做来修复它的任何想法?
我遇到了类似的问题,但根本原因是我的应用指向旧的开发数据库,该数据库已超过 10,000 行的限制.
尽管我创建了一个新的基本数据库并备份了所有内容,但该应用程序仍然指向旧的开发数据库.
heroku pg:info
检查行数:10300/10000(那么你有问题)
你需要
1)创建具有更多行的新数据库(基本或生产"行 -> Heroku 似乎正在强制升级以赚取更多的钱 errrrrr)
2) 使用 pgbackups 备份旧数据库:heroku pg:backups:capture SMALL_DB_NAME
3) 将备份恢复到新数据库:heroku pg:backups:restore BACKUP_ID BIG_DB_NAME
(更多详细信息,请参见下面的链接)
4) 将新数据库提升到应用的主数据库:heroku pg:promote BIG_DB_NAME
可以随时使用:
heroku maintenance:on
(更新时禁用应用程序)
heroku 维护:关闭
heroku pg:info
(查看状态)
如果这是您可能需要检查的问题:https://devcenter.heroku.com/articles/heroku-postgres-starter-tierhttps://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres
I've recently gone through the database migration process as outlined here:
https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres
Now I'm seeing a number of errors in the logs like this:
PGError: ERROR: permission denied for relation
Any ideas on what I should do to fix it?
I had a similar problem but the root cause was that my app was pointing to the old dev database which had exceeded it's limit of 10,000 rows.
Although I created a new Basic db and backed everything up, the app was still pointing the old dev DB.
heroku pg:info
Check to see the rows: 10300/10000 (then you have a problem)
You will need to
1) Create new DB with more rows (Basic or the "Production" ones -> Heroku seems to be forcing an upgrade to make more money errrrrr)
2) backup the old DB using pgbackups: heroku pg:backups:capture SMALL_DB_NAME
3) restore the backup to the new DB: heroku pg:backups:restore BACKUP_ID BIG_DB_NAME
(see links below for more details)
4) PROMOTE the new DB to the primary for the app: heroku pg:promote BIG_DB_NAME
can always utilize:
heroku maintenance:on
(to disable the app while updating)
heroku maintenance:off
heroku pg:info
(to check the status)
If this is the problem you may want to check out: https://devcenter.heroku.com/articles/heroku-postgres-starter-tier https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres
这篇关于PGError:错误:关系被拒绝(使用 Heroku 时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!