8

I have had a Write access revoked in my heroku dev plan as I had too many rows in my db.

Here is the result I have:

$ heroku pg:info
=== HEROKU_POSTGRESQL_WHITE_URL (DATABASE_URL)
Plan:        Dev
Status:      available
Connections: 1
PG Version:  9.2.7
Created:     2013-06-21 13:24 UTC
Data Size:   12.0 MB
Tables:      48
Rows:        10564/10000 (Write access revoked) - refreshing
Fork/Follow: Unsupported
Rollback:    Unsupported
Region:      Europe

Since then, I deleted half of the rows, as they were created by a script that degenerated, and I am in my development environment. I checked in pgadmin and in the rails console, and it appears that the rows are actually deleted.

How can I recover write access to my database? I don't want to upgrade as I don't need it normally. Been waiting for 2 hours already nothing changed.

I read heroku pg:info doesn't update really fast, but what can I do then?

Thanks for support

Augustin Riedinger
  • 20,909
  • 29
  • 133
  • 206

3 Answers3

15

For the Starter tier (now called Hobby tier), the statistics on row count, table count, and database size are calculated and updated periodically by background workers. They can lag by a few minutes, but typically not more than 5 or 10.

After you've cleared out data to get under your row limit, it may take 5-10 minutes for write access to be restored naturally. You can usually speed up this process by running pg:info, which should cause a refresh to happen (thus you see refreshing above).

2 hours is not expected. If you're still locked out and you're sure you're under the row count, please open a ticket at help.heroku.com

catsby
  • 11,276
  • 3
  • 37
  • 37
  • Maybe there has been some unexpected delay or maybe I should have run `pg:info` twice but now it came back. :) Thanks for support and accurate answer! – Augustin Riedinger Mar 05 '14 at 16:09
  • According to [this KB article](https://kb.heroku.com/write-access-revoked-on-postgres-hobby-databases) it can sometime take several hours instead of minutes for write access to be restored naturally. – Lena Oct 08 '17 at 09:19
1

According to Heroku documentation: https://devcenter.heroku.com/articles/heroku-postgres-plans#row-limit-enforcement

When you are over the hobby tier row limits and try to insert, you will see a Postgres error:

permission denied for relation <table name>

The row limits of the hobby tier database plans are enforced with the following mechanism:

  1. When a hobby-dev database hits 7,000 rows, or a hobby-basic database hits 7 million rows , the owner receives a warning email stating they are nearing their row limits.

  2. When the database exceeds its row capacity, the owner will receive an additional notification. At this point, the database will receive a 7 day grace period to either reduce the number of records, or migrate to another plan.

  3. If the number of rows still exceeds the plan capacity after 7 days, INSERT privileges will be revoked on the database. Data can still be read, updated or deleted from database. This ensures that users still have the ability to bring their database into compliance, and retain access to their data.

  4. Once the number of rows is again in compliance with the plan limit, INSERT privileges are automatically restored to the database. Note that the database sizes are checked asynchronously, so it may take a few minutes for the privileges to be restored.

So, you most likely have to upgrade your db plan

hcarreras
  • 4,442
  • 2
  • 23
  • 32
0

I faced the same restrictions but because of being in excess of heroku's GB data size limit (rather than row limit), but the outcome was the same ("Write access revoked; Database deletion imminent").

Deleting rows alone was not enough to free up disk space - After deleting the rows I had to also run the postgres VACUUM FULL command in order to see a reduction in disk space figure returned with heroku pg:info.

Here's a full explanation of the steps to solve.

stevec
  • 41,291
  • 27
  • 223
  • 311