Skip site navigation (1) Skip section navigation (2)

Re: Get the list of permissions/privileges on schema

From: dipti shah <shahdipti1980(at)gmail(dot)com>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Get the list of permissions/privileges on schema
Date: 2010-03-30 09:40:08
Message-ID: d5b05a951003300240l3780b1c8s7dee8acf055523e6@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novice
Thanks Ashesh, I ran below command and it is listing all privileges of
objects under mydb schema. Actually, I want to know what are the permissions
"user1" has on mydb schema. Could you please tell me how to do this?

mydb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where
pc.relnamespace=pn.oid and pn.nspname='mydb';
             relname              |                    relacl
----------------------------------+-----------------------------------------------
  mylog                           |
{postgres=arwdDxt/postgres,=arwdDxt/postgres}
  techtable                       | {postgres=arwdDxt/postgres,=ar/postgres}
  techtable_log                   |
  hrtable                         | {postgres=arwdDxt/postgres,=ar/postgres}
  hrtable_log                     |
(5 rows)


mydb=> select current_user;
 current_user
--------------
 user1
(1 row)

mydb=>

Thanks,
Dipti

On Thu, Mar 25, 2010 at 2:44 PM, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com
> wrote:

> You should look into the pg_class table : relacl attribute for the
> permissions on any object.
>
> --
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise Postgres Company<http://www.enterprisedb.com>
>
> On Thu, Mar 25, 2010 at 2:37 PM, dipti shah <shahdipti1980(at)gmail(dot)com>wrote:
>
>> Hi,
>>
>> Could any one please tell me how to get list of all the permissions on the
>> schema (or any postgresql objects), stored them somewhere before executing
>> stored procedure and then restore them?
>>
>> Thanks,
>> Dipti
>>
>
>

In response to

pgsql-novice by date

Next:From: Thom BrownDate: 2010-03-30 10:16:11
Subject: Re: What happens if the partitions overlap?
Previous:From: Jasen BettsDate: 2010-03-30 09:35:13
Subject: What happens if the partitions overlap?

pgsql-general by date

Next:From: Davor J.Date: 2010-03-30 10:15:19
Subject: Emphasizing "current item" in subclass of QAbstractItemView
Previous:From: AndrusDate: 2010-03-30 09:32:24
Subject: Re: How to implement word wrap

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group