pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Saikumar <saikumar1@spgroup.com.sg>
To: Guillaume Lelarge <guillaume@lelarge.info>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Postgres 8.3 Grant all on database or schema
Date: Wed, 7 Nov 2018 09:24:53 +0000
Message-ID: <13599740-F4F0-477A-BAE4-287D4F81CD1F@spgroup.com.sg> (raw)
In-Reply-To: <CAECtzeX_-dh9skb3-UWrwisW8kWmHdaYj2YAiSC-qKxFsrwxPw@mail.gmail.com>
References: <B3E7EF95-7BA6-4794-B46D-72C538173F87@spgroup.com.sg>
	<CAECtzeX_-dh9skb3-UWrwisW8kWmHdaYj2YAiSC-qKxFsrwxPw@mail.gmail.com>

Hi Guillaume,

Thanks for the update.
I found some script to implement this.

Regards,
Saikumar

From: Guillaume Lelarge <guillaume@lelarge.info>
Date: Wednesday, 7 November 2018 at 5:05 PM
To: Saikumar <saikumar1@spgroup.com.sg>
Cc: "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Subject: Re: Postgres 8.3 Grant all on database or schema

Hi,

Le mer. 7 nov. 2018 à 09:59, Saikumar <saikumar1@spgroup.com.sg<mailto:saikumar1@spgroup.com.sg>> a écrit :
Dear Sir,

I am quite new the Postgre DB and working as DBA.

I wanted to set the grant all permissions on the database to the role.

Whatever the user assign to this role should inherits the same permissions on the database tables. To achieve this scenarios, I have executed below steps.

              GRANT ALL ON database RM to RM_ADMIN_ROLE;
                create user junkai;
                ALTER ROLE junkai WITH LOGIN;
                grant RM_ADMIN_ROLE to junkai;

I login using junkai, and try to access the tables, its giving the error as permission denied error.

If I grant the same access on table level, it’s working. I have hundreds of tables in the schema. I can’t grant the permissions on table level.

I have check in the internet, all suggesting same as above. When I run the above commands, it’s not throwing any error all says granted. When I do select, It’s not allowing to fetch the data.

Could you please help why it’s not working as expected?


It's working as expected. When you GRANT ALL on a database, you give this role CREATE, TEMP and CONNECT privilege to this database (IOW, all privileges related to a database object). It doesn't give any privilege to objects inside this database. On a 8.3, you'll have to give privileges table per table. On a more recent release, you would be able to do it schema by schema. Usually, people use scripts to do this when they have a lot of tables.

Regards.


--
Guillaume.

________________________________
Singapore Power and all members of the group are now serving the public as SP Group. Our registered business address is 2 Kallang Sector, Singapore 349277 and our contact details have changed. Visit us at spgroup.com.sg<https://www.spgroup.com.sg/; or connect with us at fb.com/SPGroupSG<http://fb.com/SPGroupSG;

________________________________

This email and any files transmitted with it are confidential and intended for the named recipient only. The contents herein are privileged to the sender and the use thereof is restricted to the intended purpose. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient please do not disclose, copy, distribute or take any action in reliance on the contents of this e-mail. Thank you.
________________________________


view thread (3+ messages)

Message-ID: <13599740-F4F0-477A-BAE4-287D4F81CD1F@spgroup.com.sg>
Permalink:  ../13599740-F4F0-477A-BAE4-287D4F81CD1F@spgroup.com.sg/
Also on:    postgresql.org/message-id/13599740-F4F0-477A-BAE4-287D4F81CD1F@spgroup.com.sg

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: saikumar1@spgroup.com.sg, guillaume@lelarge.info
  Subject: Re: Postgres 8.3 Grant all on database or schema
  In-Reply-To: <13599740-F4F0-477A-BAE4-287D4F81CD1F@spgroup.com.sg>
  References: <B3E7EF95-7BA6-4794-B46D-72C538173F87@spgroup.com.sg> <CAECtzeX_-dh9skb3-UWrwisW8kWmHdaYj2YAiSC-qKxFsrwxPw@mail.gmail.com> <13599740-F4F0-477A-BAE4-287D4F81CD1F@spgroup.com.sg>

* 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