Permission Read Only User

Started by Sathish Kumarabout 7 years ago3 messagesgeneral
Jump to latest
#1Sathish Kumar
satcse88@gmail.com

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.

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sathish Kumar (#1)
Re: Permission Read Only User

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

--
Adrian Klaver
adrian.klaver@aklaver.com

#3Ron
ronljohnsonjr@gmail.com
In reply to: Adrian Klaver (#2)
Re: Permission Read Only User

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.