=?iso-8859-2?Q?Keresztury_Bal=E1zs?= <bal...@gaslightmusic.hu> writes:
> For example: there is a Service user, called Joe, who belongs to the group
> called SER. There is an other one, Kim, who's an administrator (ADM), which
> inherits rights from both SER and CEO. My problem is that I need a query,
> which returns _all_ the group names which Kim belongs to.
> I already find a solution to get the direct parents of a role, but I'd like
> to have all of them to use it for access control.

You could do something like

select rolname from pg_roles where pg_has_role('Kim', rolname, 'USAGE');

but this isn't going to be terribly efficient if you do it over and
over.  You should probably think twice about whether you really need
that data in explicit form on the client side.

                        regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to