[英]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: 缺点:
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.