From: Milen Dzhumerov <gamehack@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Table permissions
Date: Sun, 26 Mar 2006 21:34:51 +0100
Message-ID: <4426FAEB.6030205@gmail.com> (raw)
Hi all,
I had the need to find the user permissions of several tables. I figured
out that if I submit the query
SELECT relacl FROM pg_catalog.pg_class WHERE relname = 'tablename';
I get the permissions but for the table name in all schemas and not only
the one I'm interested in. Then I took a look at psql's source and I
found the query for figuring out the permissions on a table in the
describe.c file
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/describe.c?rev=1.133).
Unfortunately if I try to submit it, it gives me some error. It cannot
recognize the "n.nspname" token and other similar errors. So can anyone
help me with constructing an SQL query to figure out the permissions on
a table in a specific schema? My other question is who has access to the
pg_catalog.* tables? Is it true that every user can examine them? And
are these tables per database or shared across PgSQL? Is is true that
every user can check if he/she has access to a particular table and
examine the ACL string? And how can I determine if a user can change
permissions for other users?
Kind regards,
gamehack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: gamehack@gmail.com
Subject: Re: Table permissions
In-Reply-To: <4426FAEB.6030205@gmail.com>
References: <4426FAEB.6030205@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox