Steps to Troubleshoot “django.db.utils.ProgrammingError: permission denied for relation django_migrations”

后端 未结 3 948
闹比i
闹比i 2020-12-08 04:15

What are some basic steps for troubleshooting and narrowing down the cause for the \"django.db.utils.ProgrammingError: permission denied for relation django_migrations\" err

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 04:59

    I was able to solve my issue based on instructions from this question. Basically, postgres privileges needed to be re-granted to the db user. In my case, that was the user I had setup in the virtual environment settings file. Run the following from the commandline (or within postgres) where mydatabase and dbuser should be your own database and user names:

    psql mydatabase -c "GRANT ALL ON ALL TABLES IN SCHEMA public to dbuser;"
    psql mydatabase -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public to dbuser;"
    psql mydatabase -c "GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to dbuser;"
    

提交回复
热议问题