Re: How to list all the privileges a user has?

From: "Ben K(dot)" <bkim(at)coe(dot)tamu(dot)edu>
To: kynn(at)panix(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to list all the privileges a user has?
Date: 2006-05-07 06:19:06
Message-ID: Pine.GSO.4.64.0605070112490.25732@coe.tamu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Donald Fraser 2006-05-08 08:04:35 Constraint Triggers
Previous Message Mingzuo Shen 2006-05-06 13:39:31 databases missing