9

When creating a PostgreSQL database one can assign another role to be an owner of that database. What can the new owner do with this database? How is it compared to grants?

8

When an object is created, it is assigned an owner. The owner is normally the role that executed the creation statement. For most kinds of objects, the initial state is that only the owner (or a superuser) can do anything with the object. To allow other roles to use it, privileges must be granted.

The right to modify or destroy an object is always the privilege of the owner only.

http://www.postgresql.org/docs/current/static/ddl-priv.html

  • 1
    Is it ok to have postgres (superuser) be the owner of the database? Is it better to create new roles with limited rights to be the owner? – Joseph K. Aug 4 '19 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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