pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rui DeSousa <rui@crazybean.net>
To: pavan95 <pavan.postgresdba@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to revoke "Create Privilege" from a readonly user in postgres?
Date: Wed, 7 Nov 2018 07:08:52 -0500
Message-ID: <B71F44B3-023E-41A4-9B38-FEB4417F546C@crazybean.net> (raw)
In-Reply-To: <1541574536956-0.post@n3.nabble.com>
References: <1541419964128-0.post@n3.nabble.com>
	<E3F51CC1-3549-460C-83D2-7C3E26B026C6@crazybean.net>
	<1541569945694-0.post@n3.nabble.com>
	<2A936B5B-CF6A-41E5-B839-E6CE7EDB8CF7@crazybean.net>
	<1541574536956-0.post@n3.nabble.com>

First I don’t know what I was thinking… I think this only change the default for the current use… not all users; I just never use this form.

alter default privileges in schema readonly grant select on tables to readonly;



> On Nov 7, 2018, at 2:08 AM, pavan95 <pavan.postgresdba@gmail.com> wrote:
> 
> Rui,
> 
> Thanks for responding. I'm perfectly alright with this approach. But can we
> do the same in "PUBLIC" schema??
> 

Yeah; but why I think it already defaults to that; like I said before you should drop the public schema and not use it.

The other option is to revoke from the public role on the public schema.

I normally create a schema owner user that owns the objects and is only use for creating objects.  Then I alter it default privileges to grant what ever access the application needs and other user role needs, etc.  It’s always better to be granular if you development model supports it instead of sweeping rules.



view thread (9+ messages)

Message-ID: <B71F44B3-023E-41A4-9B38-FEB4417F546C@crazybean.net>
Permalink:  ../B71F44B3-023E-41A4-9B38-FEB4417F546C@crazybean.net/
Also on:    postgresql.org/message-id/B71F44B3-023E-41A4-9B38-FEB4417F546C@crazybean.net

 · 

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-admin@postgresql.org
  Cc: rui@crazybean.net, pavan.postgresdba@gmail.com
  Subject: Re: How to revoke "Create Privilege" from a readonly user in postgres?
  In-Reply-To: <B71F44B3-023E-41A4-9B38-FEB4417F546C@crazybean.net>
  References: <1541419964128-0.post@n3.nabble.com> <E3F51CC1-3549-460C-83D2-7C3E26B026C6@crazybean.net> <1541569945694-0.post@n3.nabble.com> <2A936B5B-CF6A-41E5-B839-E6CE7EDB8CF7@crazybean.net> <1541574536956-0.post@n3.nabble.com> <B71F44B3-023E-41A4-9B38-FEB4417F546C@crazybean.net>

* 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