pink_daemon
pink_daemon

Reputation: 374

PostgreSQL: How to GRANT permission to GRANT permission in specific SCHEMA

I have a sample database containing two schemas and I have two roles in the database.

I need to grant rights in a way that

(essentially "schema-specific admins")

Would someone know a possible approach to this?

Upvotes: 2

Views: 489

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 248305

I can think of two ways:

  • the “administrator role” for each schema owns the objects in that schema – then the requirement is automatically fulfilled

  • all objects are owned by the same role, and that role uses GRANT ... WITH GRANT OPTION on all tables in each schema to the respective administrative role

I'd prefer the first option, because it is simpler.

Upvotes: 1

Related Questions