2

I'm trying to understand if it's okay for me drop the "postgres" role, or at the least, remove it as the superuser. Thanks!

0

1 Answer 1

7

I'm trying to understand if it's okay for me drop the "postgres" role, or at the least, remove it as the superuser.

Dropping the role owning the template databases and all the system tables of all databases is not possible. There is even a specific error for that, should you try to DROP ROLE postgres:

ERROR: cannot drop role postgres because it is required by the database system


It's technically possible to remove the superuser capability to postgres, but if there is no superuser left in the system, any administrative task that only a superuser can do will be out of reach, and that would be really inconvenient.

On the other hand, it's entirely reasonable to deny through pg_hba.conf the ability for the postgres role to connect remotely, and also to set and enforce a password for the postgres account even for local-only connections.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.