简体   繁体   English

Heroku:PG ::错误:错误:关系权限被拒绝

[英]Heroku: PG::Error: ERROR: permission denied for relation

Every time when I try to save something into the database, I get this error message. 每当我尝试将某些内容保存到数据库中时,我都会收到此错误消息。 I saw that Heroku offer free PostgreSQL database for the first 10.000 records, above 10.000 records is needed to pay for the database. 我看到Heroku为前10,000条记录提供免费的PostgreSQL数据库,需要超过10.000条记录才能支付数据库费用。

Right now, in my database is like 60.000 records. 现在,在我的数据库中就像是60.000条记录。 How to fix that error/upgrade database? 如何修复该错误/升级数据库?

Thank you in advance 先感谢您

You'll want to use the PG Backups add-on to backup your database then migrate from your dev/basic plan to a production-grade (paid) plan. 您将需要使用PG备份插件来备份数据库,然后从您的开发/基本计划迁移到生产级(付费)计划。

The short of it: 缺点:

  • Provision new production grade Heroku Postgresql plan 提供新的生产等级Heroku Postgresql计划
  • Put your app on maintenance mode to prevent new updates 将您的应用程序置于维护模式以防止新的更新
  • Capture the backup 捕获备份
  • Restore to the upgraded database 还原到已升级的数据库
  • Promote new database to primary 将新数据库提升为主数据库
  • Reactivate your app 重新启动您的应用

https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups

You are over your limit. 你超过了你的极限。 You need to upgrade to a larger plan , delete data, or live with having read-only access. 您需要升级到更大的计划 ,删除数据或拥有只读访问权限。 Those are your only three options. 这是你唯一的三个选择。

First of all, you have to upgrade your plan on heroku. 首先,您必须在heroku上升级您的计划。 To do that, go to this link. 为此,请转到链接。

This is a very nice article where all the steps to migrate a DB on heroku to another plan are explained. 是一篇非常好的文章,其中解释了将heroku上的数据库迁移到另一个计划的所有步骤。

I have also faced this problem and fixed the problem smoothly with the help of the above tutorial. 我也遇到了这个问题并在上面的教程的帮助下顺利解决了问题。

Or : 要么 :

Load a dump of you db locally. 在本地加载db的转储。 Clean this up. 清理这个。 Put this dump on heroku. 把这个转储放在heroku上。

Or : 要么 :

Connect via psql or pgadmin to the remote database and clean this up. 通过psql或pgadmin连接到远程数据库并清理它。

This answer isn't sponsored by Heroku 这个答案不是由Heroku赞助的

Just wanted to add my solution for posterity. 只是想为后代添加我的解决方案。 I had the same issue where I was getting the error :Heroku: PG::Error: ERROR: permission denied for relation" event though I was only using 180/10000 rows of my DB. I did: 我遇到了同样的问题我得到了错误:Heroku: PG::Error: ERROR: permission denied for relation"事件被:Heroku: PG::Error: ERROR: permission denied for relation"但事件虽然我只使用了我的数据库的180/10000行。我做了:

heroku restart

and this fixed the issue. 这解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:Heroku pg_dump之后导入到开发数据库后,该关系的权限被拒绝 - ERROR: permission denied for relation after Heroku pg_dump and import to development database PG ::错误:错误:关系schema_migrations的权限被拒绝 - PG::Error: ERROR: permission denied for relation schema_migrations PG::InsufficientPrivilege at / 错误:关系 schema_migrations 的权限被拒绝 - PG::InsufficientPrivilege at / ERROR: permission denied for relation schema_migrations ActiveRecord::StatementInvalid (PG::InsufficientPrivilege: ERROR: permission denied for relationship - ActiveRecord::StatementInvalid (PG::InsufficientPrivilege: ERROR: permission denied for relation Rails:PG::InsufficientPrivilege:错误:关系 schema_migrations 的权限被拒绝 - Rails: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations Ruby on Rails INSERT 错误 ***** PG::InsufficientPrivilege: 错误:关系发票的权限被拒绝 - Ruby on Rails INSERT Error ***** PG::InsufficientPrivilege: ERROR: permission denied for relation invoices ActiveRecord :: StatementInvalid:PG :: InsufficientPrivilege:错误:关系schema_migrations的权限被拒绝 - ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations PG ::错误:错误:关系“用户”在Heroku上不存在 - PG::Error: ERROR: relation “users” does not exist on Heroku Heroku迁移:PG ::错误:错误:关系“角色”不存在 - Heroku migration: PG::Error: ERROR: relation “roles” does not exist 全球化,Heroku:PG :: UndefinedTable:错误:关系不存在 - Globalize, Heroku: PG::UndefinedTable: ERROR: relation does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM