Getting users/privs for tables.

Started by Gauthier, Daveabout 15 years ago4 messagesgeneral
Jump to latest
#1Gauthier, Dave
dave.gauthier@intel.com

Hi:

I'm trying to determine who has what privs for what tables. Couldn't find any canned views for that (but may have missed it). Or is there a query that can get this from the metadata somehow?

Thanks in Advance.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gauthier, Dave (#1)
Re: Getting users/privs for tables.

"Gauthier, Dave" <dave.gauthier@intel.com> writes:

I'm trying to determine who has what privs for what tables. Couldn't find any canned views for that (but may have missed it). Or is there a query that can get this from the metadata somehow?

You could try using has_table_privilege() in a join between pg_class and
pg_authid ... might be a bit slow though.

regards, tom lane

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Gauthier, Dave (#1)
Re: Getting users/privs for tables.

On Thursday, March 17, 2011 7:48:37 am Gauthier, Dave wrote:

Hi:

I'm trying to determine who has what privs for what tables. Couldn't find
any canned views for that (but may have missed it). Or is there a query
that can get this from the metadata somehow?

Thanks in Advance.

http://www.postgresql.org/docs/9.0/interactive/information-schema.html

role_table_grants
and/or
table_privileges

--
Adrian Klaver
adrian.klaver@gmail.com

#4Gauthier, Dave
dave.gauthier@intel.com
In reply to: Adrian Klaver (#3)
Re: Getting users/privs for tables.

information_schema.table_privileges has it. Thanks !

From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Thursday, March 17, 2011 10:59 AM
To: pgsql-general@postgresql.org
Cc: Gauthier, Dave
Subject: Re: [GENERAL] Getting users/privs for tables.

On Thursday, March 17, 2011 7:48:37 am Gauthier, Dave wrote:

Hi:

I'm trying to determine who has what privs for what tables. Couldn't find

any canned views for that (but may have missed it). Or is there a query

that can get this from the metadata somehow?

Thanks in Advance.

http://www.postgresql.org/docs/9.0/interactive/information-schema.html

role_table_grants

and/or

table_privileges

--

Adrian Klaver

adrian.klaver@gmail.com