Issue
Your Postgres Hobby/Mini/Basic Databases row limit has been exceeded for more than 7 days and write access has been revoked.
Because of this, you might see PG::Error: ERROR: permission denied for relation
errors when writing to your database. Running pg:info
for your Hobby/Mini/Basic database will show "Rows: (Write access revoked)" in this scenario.
Resolution
You've exceeded the row limit of your Postgres Hobby/Mini/Basic database for more than 7 days, meaning that your write access has been revoked. The best solution, if you're going to need a larger database, is to upgrade to a paid plan.
If you're unable to upgrade, you will need to delete the necessary rows from your database to bring it back within compliance of the limits for your plan. You will still have delete
permissions to your database so that you can do this. We periodically check for database row limit compliance, but if you have had your write access revoked, it could take up to several hours before permissions are restored if you take the deletion route.
More information is available here: https://devcenter.heroku.com/articles/heroku-postgres-plans#hobby-tier
You can run this query to find out which tables have the most rows:
SELECT schemaname, relname, n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;