pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL
2+ messages / 2 participants
[nested] [flat]

* How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL
@ 2013-01-08 02:15  戴松晚 <151359779@qq.com>
  0 siblings, 1 reply; 2+ messages in thread

From: 戴松晚 @ 2013-01-08 02:15 UTC (permalink / raw)
  To: pgsql-admin

<br>I have created a user(user1), and with this user I created a db1 and some tables, some functions in it.<br>Now I want to create another user(user2), and I want the two users can access everything in the database db1,<br>like GRANT ALL ON DB1 TO 'USER'@'%' ... in MYSQL.<br><br>For example:<br>1, The two users can access all of the exist relations.<br>2, User2 can access the relations that are created by user1 in the future without any 'grant....'.<br>3, User1 can access the tables, functions and so on that are created by user2.<br><br>Is there any way to do that?<br>Any insight would be greatly appreciated!<br><br><div><div style="color: rgb(144, 144, 144); font-family: Arial Narrow; font-size: 12px;">------------------</div><div style="font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0);">watson dai<br></div></div><div><br></div>

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL
@ 2013-01-14 17:43  Casey Allen Shobe <casey@shobe.info>
  parent: 戴松晚 <151359779@qq.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Casey Allen Shobe @ 2013-01-14 17:43 UTC (permalink / raw)
  To: 戴松晚 <151359779@qq.com>; +Cc: pgsql-admin

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-01-14 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-01-08 02:15 How to implement the 'GRANT ALL ON DB1 TO 'USER'@'%' of MYSQL in PostgreSQL 戴松晚 <151359779@qq.com>
2013-01-14 17:43 ` Casey Allen Shobe <casey@shobe.info>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox