How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL

Поиск
Список
Период
Сортировка
Искать

How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL

От:
"戴松晚" <151359779@qq.com>
Дата:

I have created a user(user1), and with this user I created a db1 and some tables, some functions in it.
Now I want to create another user(user2), and I want the two users can access everything in the database db1,
like GRANT ALL ON DB1 TO 'USER'@'%' ... in MYSQL.

For example:
1, The two users can access all of the exist relations.
2, User2 can access the relations that are created by user1 in the future without any 'grant....'.
3, User1 can access the tables, functions and so on that are created by user2.

Is there any way to do that?
Any insight would be greatly appreciated!

------------------
watson dai

Re: How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL

От:
Casey Allen Shobe <casey@shobe.info>
Дата:
I'd recommend setting up group roles (roles which cannot login) to grant your various permission sets to, and then add users to the appropriate groups, using permission inheritence.  Then any grants/revokes you make in the future to the groups automatically apply to the users.  You may wish to divide up permissions into several groups for manageability.
On Mon, Jan 7, 2013 at 9:15 PM, 戴松晚 <151359779@qq.com> wrote:
1, The two users can access all of the exist relations.
 
Provided by them having membership of the same group.
 
2, User2 can access the relations that are created by user1 in the future without any 'grant....'.
3, User1 can access the tables, functions and so on that are created by user2.
 
Grant will still be required, but only once (to the appropriate group).
 
Cheers,
--
Casey Allen Shobe
casey@shobe.info


FAQ