Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

permission denied for relation django_migrations

I am using Django CMS, I want to take backup of my database. But when I am firing the query to take my back of database:

pg_dump -U postgres -h 127.0.0.1 -p 5432 db_name > db_name_backup.sql

After firing the query I am getting the following error:

pg_dump: [archiver (db)] query failed: ERROR: permission denied for relation django_migrations

pg_dump: [archiver (db)] query was: LOCK TABLE public.django_migrations IN ACCESS SHARE MODE

Can anyone help me on this?

like image 497
Rajat Gupta Avatar asked Nov 23 '15 05:11

Rajat Gupta


1 Answers

Sounds like it's down to permissions, so make sure you at least have USAGE for relevant schema and the SELECT privilege for the table.

Check out this answer for much greater detail.

like image 161
markwalker_ Avatar answered Oct 16 '22 17:10

markwalker_