pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pavan95 <pavan.postgresdba@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: Granting any privilege for a specific set of tables in postgres in a single shot!..
Date: Wed, 25 Jul 2018 06:32:18 -0700 (MST)
Message-ID: <1532525538301-0.post@n3.nabble.com> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <1532525538301-0.post@n3.nabble.com>
Permalink:  ../1532525538301-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1532525538301-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pavan.postgresdba@gmail.com
  Subject: Re: Granting any privilege for a specific set of tables in postgres in a single shot!..
  In-Reply-To: <1532525538301-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox