Why am I getting the PostgreSQL error "PGError: ERROR: permission denied for relation"

Issue

You are seeing "PGError: ERROR: permission denied for relation" in your application logs

Resolution

The permission denied for relation error is a general PostgreSQL error meaning that the user that's connected to the database doesn't have access to write or read a specific table.

Common causes of this error in Heroku Postgres databases are the following:

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support