DEV Community

sium_hossain
sium_hossain

Posted on

Permission denied to create extension "extension_name" HINT: Must be superuser to create this extension postgres

If you want install a extension in your postgresql database via python manage.py migrate it will throw an error if database user is not a super user. We can resolve this issue by give superuser permission to our current user. We can also withdraw super user permission after that 😬.

Login psql by current user via -



sudo -u postgres psql


Enter fullscreen mode Exit fullscreen mode

then ->



postgres-# alter role <user_name> superuser;


Enter fullscreen mode Exit fullscreen mode

this user should be in your database config user profile -
Permission denied to create extension HINT: Must be superuser to create this extension postgres"/>

exit from database by -



\q 


Enter fullscreen mode Exit fullscreen mode

Then you can successfully migrate.

Oh! hold on
If you want alter super user permission by after login with current user in psql -



postgres-# alter role <user_name> nosuperuser;


Enter fullscreen mode Exit fullscreen mode

Thank you...

Top comments (0)