Re: Granting any privilege for a specific set of tables in postgres in a single shot!..

From: pavan95 <pavan(dot)postgresdba(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Granting any privilege for a specific set of tables in postgres in a single shot!..
Date: 2018-07-25 13:32:18
Message-ID: 1532525538301-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi all,

Hope my mail finds you in good time. I have a question in regards to
"Grant" command.

How can I grant a particular privilege to a specific set of objects(tables)
in a single shot ?

FYI, please consider the following scenario. I have a database "abc" with
users as "u1","u2","u3","u4". And there are 1500 tables in my database.

Now my requirement is to grant select on 800 tables(specific set of tables)
which suits my requirement. I know that I can use the below statement 800
times.

grant select on table1 to u1;
grant select on table2 to u1;
.
.
.
.
.
.
grant select on table800 to u1;

My question is can't I do it in a single shot? Can I fit some select query
which passes the table name as a parameter in the middle of the grant
statement?

Please advice.

Thanks in Advance.

Regards,
Pavan

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2018-07-25 13:41:52 Re: Granting any privilege for a specific set of tables in postgres in a single shot!..
Previous Message Peter Eisentraut 2018-07-25 13:10:25 Re: plpython3u and virtualenv