DEV Community

sium_hossain
sium_hossain

Posted on

3

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...

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more