Dear postgresql experts!

After this command:

db=> CREATE EXTENSION IF NOT EXISTS ext WITH SCHEMA test; ERROR: permission denied to create extension "ext" HINT: Must be superuser to create this extension. 

Question: how to create a superuser from an existing user?

  • 2
    Do you really need superuser rights? The documentation recommends something else: It’s good practice . This approach avoids you really need it. - Akina

1 answer 1

You must do the following:

ALTER USER user WITH SUPERUSER;

Instead of user , your username is appropriate.

  • 2
    there is still need to add that it should be done from under the superuser, such as postgres - alwizo