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

Get the list of permissions on schema for current user

From: dipti shah <shahdipti1980(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Get the list of permissions on schema for current user
Date: 2010-03-30 11:05:27
Message-ID: d5b05a951003300405t47e4e552n249e172386cddff6@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novice
Hi,

I ran below command to list out all privileges of objects if "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

Responses

pgsql-novice by date

Next:From: Tyler HainsDate: 2010-03-30 12:46:53
Subject: FW: plpgsql function help
Previous:From: Thom BrownDate: 2010-03-30 10:16:11
Subject: Re: What happens if the partitions overlap?

pgsql-general by date

Next:From: Oliver Kohll - Mailing ListsDate: 2010-03-30 11:06:16
Subject: Running/cumulative count using windows
Previous:From: Szymon GuzDate: 2010-03-30 10:42:41
Subject: Re: insert into test_b (select * from test_a) with different column order

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