Mastodon Mastodon - Django, psql & “permission denied” on migrate
 logo
  • Home 
  • Tags 
  • Blog posts 
  1. Home
  2. Blog posts
  3. Django, psql & “permission denied” on migrate

Django, psql & “permission denied” on migrate

Posted on October 16, 2018  (Last modified on July 11, 2024) • 1 min read • 65 words
Django  
Django  
Share via

I got this error:

psycopg2.ProgrammingError: permission denied for relation django_migrations

… when I wanted to do a “python manage.py migrate”. This post had the solution. In short: You have to change the owner of the tables to the one specified in the Django configuration.

This is how my script looks:

#!/usr/bin/env bash
echo "ALTER TABLE public.django_admin_log OWNER TO <new_owner>;" | psql -U <current_owner> <database>
# ...
 Misc Django I – forms
Firefox close tab buttons on mouse hover 
In case you want to follow me

Here are some links. The further to the right, the less active.

           
(c) Axel Bock | Powered by Hinode.
Link copied to clipboard
Code copied to clipboard