Assign different roles to the same user on different databases on the same server
I've setup our postgresql server with two databases: one production and one training. I would like users to be limited to their true roles in the production database, but b开发者_如何学Goe given free reign in the training database.
ie. Assign one set of roles to a user on one database, and another set of roles to the same user in a different database on the same server.
I figure one way around this would be to create a new "training" role with full access, and then limit this role to just the training database using pg_hba.conf. It's not what I'm hoping for, but is this the only option?
You can GRANT
different privileges to different ROLES
in different databases, but ROLES
are global to the entire server. You might consider using GROUPS
(prod_dba group vs dev_dba group) and then assign users to the different groups.
精彩评论