Thread: Permissions on Tables

Permissions on Tables

From
Luis Magaña
Date:
Hi:

    I'm writing a interface that should manage users groups and permissions on tables in a database.  Have almost
completedusers and groups handling, but now I'm facing a problem... How can I find out what  
are the permissions on a table without using \dp ?.  This should be done through a SELECT or something similar.  Thanks
forany help gentlemans. 

--
Luis Magaña
Gnovus Networks & Software
www.gnovus.com
Tel. +52 (7) 4422425
joe666@gnovus.com



RE: Permissions on Tables

From
"Edmar Wiggers"
Date:
Try using adding -E option to psql. It will show you the queries used to
answer \d* (and other) commands.

psql -E test
test=> \dp
********* QUERY *********
SELECT relname as "Relation",
       relacl as "Access permissions"
FROM   pg_class
WHERE  ( relkind = 'r' OR relkind = 'S') AND
       relname !~ '^pg_'
ORDER BY relname
*************************
...

>     I'm writing a interface that should manage users groups and
> permissions on tables in a database.  Have almost completed users
> and groups handling, but now I'm facing a problem... How can I
> find out what
> are the permissions on a table without using \dp ?.  This should
> be done through a SELECT or something similar.  Thanks for any
> help gentlemans.

Take care,

Edmar


RE: Permissions on Tables

From
Luis Magaña
Date:
Thanks, that was the solution

--
Luis Magaña
Gnovus Networks & Software
www.gnovus.com
Tel. +52 (7) 4422425
joe666@gnovus.com

Original message from: "Edmar Wiggers"
>Try using adding -E option to psql. It will show you the queries used to
>answer \d* (and other) commands.
>
>psql -E test
>test=> \dp
>********* QUERY *********
>SELECT relname as "Relation",
>       relacl as "Access permissions"
>FROM   pg_class
>WHERE  ( relkind = 'r' OR relkind = 'S') AND
>       relname !~ '^pg_'
>ORDER BY relname
>*************************
>...
>
>>     I'm writing a interface that should manage users groups and
>> permissions on tables in a database.  Have almost completed users
>> and groups handling, but now I'm facing a problem... How can I
>> find out what
>> are the permissions on a table without using \dp ?.  This should
>> be done through a SELECT or something similar.  Thanks for any
>> help gentlemans.
>
>Take care,
>
>Edmar
>
>