pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedReplicating privileges from one user to another
2+ messages / 2 participants
[nested] [flat]
* Replicating privileges from one user to another
@ 2011-07-19 19:02 Mario Splivalo <mario.splivalo@megafon.hr>
0 siblings, 1 reply; 2+ messages in thread
From: Mario Splivalo @ 2011-07-19 19:02 UTC (permalink / raw)
To: pgsql-admin
I have user foo that is owner of database dbfoo. Now I need to create
user baz that will have the exact same privileges as user foo on
database baz. I've tried this:
GRANT ALL ON DATABASE dbfoo TO baz;
but I still can't select form tables.
Is there a easier way, or do I need to go trough all the
tables/views/functions/schemas and issue GRANT ALL ON ... TO USER baz?
Mario
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Replicating privileges from one user to another
@ 2011-07-19 19:09 Kevin Grittner <Kevin.Grittner@wicourts.gov>
parent: Mario Splivalo <mario.splivalo@megafon.hr>
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Grittner @ 2011-07-19 19:09 UTC (permalink / raw)
To: Mario Splivalo <mario.splivalo@megafon.hr>; pgsql-admin
Mario Splivalo <mario.splivalo@megafon.hr> wrote:
> I have user foo that is owner of database dbfoo. Now I need to
> create user baz that will have the exact same privileges as user
> foo on database baz. I've tried this:
>
> GRANT ALL ON DATABASE dbfoo TO baz;
>
> but I still can't select form tables.
Did you mean that you want user baz to have the same privileges on
as user foo on database dbfoo?
If so, how about:
GRANT foo TO baz;
A USER is just a ROLE with login privileges -- you can make other
roles a member of the role. Be aware that if you do it this way, any
privileges later granted to or revoked from foo will also affect
baz. (I don't know whether that's what you want.)
-Kevin
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-07-19 19:09 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-07-19 19:02 Replicating privileges from one user to another Mario Splivalo <mario.splivalo@megafon.hr>
2011-07-19 19:09 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
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