Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to list all the privileges a user has?

0 views
Skip to first unread message

ky...@panix.com

unread,
May 6, 2006, 8:25:43 AM5/6/06
to


My apologies for all these questions. I hope this will be the last
one for a while.

I guess the subject line says it all: how does one list all the
privileges a given user has?

Thanks!

kj

I'm aware of functions like has_table_privilege(), etc., but they
don't do what I want.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Ben K.

unread,
May 7, 2006, 2:19:06 AM5/7/06
to
> My apologies for all these questions. I hope this will be the last
> one for a while.
> I guess the subject line says it all: how does one list all the
> privileges a given user has?

# select relname, array_to_string(relacl,',') as acl from pg_class
where array_to_string(relacl,',') ~ 'givenuser/';

Thought there was a thread a short while ago, but couldn't find it. String
functions can be used to manipulate the acl string.

If it's changed to
~'/givenuser'
you will get the list of privs the user gave to others.

Regards,

Ben K.
Developer
http://benix.tamu.edu

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

0 new messages