[Fixed]-Psycopg2.errors.InsufficientPrivilege: permission denied for relation django_migrations

22👍

I had the following error.

psycopg2.errors.InsufficientPrivilege: permission denied for table django_migrations

Granted privileges of superuser ‘postgres’ to the one I was working with.

For me, this command worked:

GRANT postgres TO <user>;

8👍

After restoring database, all tables will be owned by postgres user.

You need to do this grant:

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO <user>;

I got the same problem and that solved.

You’ll need also to grant other privileges to Django user:

GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO <user>;

0👍

Please try using the below command, this worked for me

GRANT rds_superuser TO username;
👤Arpit

Leave a comment