Re: Table permissions

From: Milen Dzhumerov <gamehack(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Table permissions
Date: 2006-03-27 15:43:04
Message-ID: 44280808.6070500@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Peter Eisentraut wrote:
> Milen Dzhumerov wrote:
>
>> Unfortunately if I try to submit it, it gives me some
>> error.
>>
>
> You need to post your exact input and the exact output. Otherwise we're
> just guessing.
>
>
>> My other
>> question is who has access to the pg_catalog.* tables?
>>
>
> Everybody.
>
>
>> And are these tables per database
>> or shared across PgSQL?
>>
>
> Most of them are per database, only a few of them are shared.
>
>
>> Is is true that every user can check if
>> he/she has access to a particular table and examine the ACL string?
>>
>
> Yes.
>
>
>> And how can I determine if a user can change permissions for other
>> users?
>>
>
> You can check the grant options available to the user.
>
>
I just worked out the query which does the job and wanted to post it so
if anyone wants in the future can refer to this thread. Here's the query:

SELECT pg_catalog.pg_class.relacl AS permissions FROM
pg_catalog.pg_class WHERE pg_catalog.pg_class.relname = 'table_name' AND
pg_catalog.pg_class.relnamespace IN (SELECT pg_catalog.pg_namespace.oid
FROM pg_catalog.pg_namespace WHERE pg_catalog.pg_namespace.nspname =
'schema_name');

Kind regards,
gamehack

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Sriram Dandapani 2006-03-27 17:28:43 Re: WAL file naming convention
Previous Message Peter Eisentraut 2006-03-27 12:33:16 Re: database locale and system locale