pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Permission Read Only User
Date: Fri, 15 Mar 2019 20:02:21 -0500
Message-ID: <24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.com> (raw)
In-Reply-To: <ddb43eb9-a4a3-f2a1-0879-876387a9d7f3@aklaver.com>
References: <CANa_DOhWNhL91ew2Rv0ujmGUkAvR5YFwBi-H1nrYsSZuEpSFZA@mail.gmail.com>
	<ddb43eb9-a4a3-f2a1-0879-876387a9d7f3@aklaver.com>

On 3/15/19 6:44 PM, Adrian Klaver wrote:
> On 3/15/19 4:37 PM, Sathish Kumar wrote:
>> Hi All,
>>
>> I have created a read only user to perform select statements on our 
>> database but whenever we create new tables on the database this user is 
>> unable to view it unless I grant select again for this table. Is there a 
>> way I can make select as default permission for this user so that in 
>> future if I create any new tables, it will be still accessible.
>
> Maybe this?:
>
> https://www.postgresql.org/docs/11/sql-alterdefaultprivileges.html

That's just what we used.

Create a role READONLY who is granted CONNECT and alter the default 
permissions on all your schemas to grant SELECT to that role.

Then create "user" roles which inherit from READONLY.

-- 
Angular momentum makes the world go 'round.




view thread (3+ messages)

Message-ID: <24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.com>
Permalink:  ../24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.com/
Also on:    postgresql.org/message-id/24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.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 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: ronljohnsonjr@gmail.com
  Subject: Re: Permission Read Only User
  In-Reply-To: <24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.com>
  References: <CANa_DOhWNhL91ew2Rv0ujmGUkAvR5YFwBi-H1nrYsSZuEpSFZA@mail.gmail.com> <ddb43eb9-a4a3-f2a1-0879-876387a9d7f3@aklaver.com> <24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.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