Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

Right now, in my database is like 60.000 records. How to fix that error/upgrade database?

Thank you in advance

like image 299
user984621 Avatar asked Nov 20 '12 09:11

user984621


People also ask

What is connection limit in PostgreSQL Heroku?

Heroku provides managed Postgres databases. Different tiered databases have different connection limits. The Hobby Tier databases are limited to 20 connections. Standard and higher tier databases have higher limits.

What is Database_url in Heroku?

DATABASE_URL contains the URL your app uses to access the database. If your app already has a Heroku Postgres database and you've provisioned another one, this config var's name instead has the format HEROKU_POSTGRESQL_<COLOR>_URL (for example, HEROKU_POSTGRESQL_YELLOW_URL ).


1 Answers

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.

The short of it:

  • Provision new production grade Heroku Postgresql plan
  • 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

like image 160
Alistair A. Israel Avatar answered Oct 12 '22 23:10

Alistair A. Israel