Re: Replicating privileges from one user to another

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Mario Splivalo" <mario(dot)splivalo(at)megafon(dot)hr>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Replicating privileges from one user to another
Date: 2011-07-19 19:09:54
Message-ID: 4E259032020000250003F4FD@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mario Splivalo <mario(dot)splivalo(at)megafon(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ken Caruso 2011-07-19 19:27:22 Re: 9.0.4 Data corruption issue
Previous Message Mario Splivalo 2011-07-19 19:02:35 Replicating privileges from one user to another