Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PG:InsufficientPrivilege: ERROR when trying to make an INSERT on stage database

Im using heroku and postgres. Local is working fine but whenever the user (any user) performs an INSERT on stage it crashes. This is the message i get:

PG:InsufficientPrivilege: ERROR: permission denied for relation .. INSERT INTO..

I granted privileges to public on the required tables but it doesn´t make a difference. Any insight would be useful. Thanks.

like image 356
user2246615 Avatar asked Aug 27 '13 14:08

user2246615


1 Answers

I know it's waaaaay late, but I just ran into this issue and I believe the problem is that you have exceeded the number of rows allowed for your DB. In my case, I was using a Hobby-dev plan and the limit is 10k rows. If you run heroku pg:info you will see something like:

=== HEROKU_POSTGRESQL_BRONZE_URL (DATABASE_URL)
Plan:        Hobby-dev
Status:      Available
Connections: 4/20
PG Version:  9.3.3
Created:     2014-05-27 15:07 UTC
Data Size:   175.5 MB
Tables:      47
Rows:        409300/10000 (Write access revoked)
Fork/Follow: Unsupported
Rollback:    Unsupported

With the Write access revoked being the key piece of information. Upgrading your DB (or deleting some data) should solve this.

like image 119
Ruy Diaz Avatar answered Nov 02 '22 07:11

Ruy Diaz