Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiJtx-0001qZ-5q for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jul 2018 13:32:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiJtu-0007Mn-H8 for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jul 2018 13:32:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiJtu-0007Mg-6L for pgsql-admin@lists.postgresql.org; Wed, 25 Jul 2018 13:32:22 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiJtr-00020r-GU for pgsql-admin@postgresql.org; Wed, 25 Jul 2018 13:32:21 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 545CCE352160 for ; Wed, 25 Jul 2018 06:32:18 -0700 (MST) Date: Wed, 25 Jul 2018 06:32:18 -0700 (MST) From: pavan95 To: pgsql-admin@postgresql.org Message-ID: <1532525538301-0.post@n3.nabble.com> Subject: Re: Granting any privilege for a specific set of tables in postgres in a single shot!.. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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