I\'m trying to run unit tests in Django, and it creates a new database. The database has postgis extensions and when I regularly create the database, I use \"CREATE ExTENSIO
A safe way to do this without delegating superuser privileges would be to access the database in which we are executing the query with a user with a superuser role such as postgres.
$ sudo -u postgres psql
#= CREATE EXTENSION IF NOT EXISTS ;
This way you don't expose security and you can believe the extension in the db.
GL