pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Read only user permission
Date: Wed, 23 Aug 2023 20:12:34 -0600
Message-ID: <14f02a5e-4f6d-70a2-3cfb-fb783748c64a@gmail.com> (raw)
In-Reply-To: <BLAPR17MB419337242CDCB04453E54D10D21CA@BLAPR17MB4193.namprd17.prod.outlook.com>
References: <BLAPR17MB419317757B0A5D24F5076CBCD21CA@BLAPR17MB4193.namprd17.prod.outlook.com>
	<2050922589.351126.1692813073578@office.mailbox.org>
	<BLAPR17MB419337242CDCB04453E54D10D21CA@BLAPR17MB4193.namprd17.prod.outlook.com>

On 8/23/23 13:23, Hellen Jiang wrote:
>
> Sorry it is a typo in the email. My readonly role is dbreadonly. It 
> works well so far except no access to new tables created by read write 
> role. It has access to new tables created by admin role.
>
> I granted dbreadonly as the following:
>
> -- Read-only role
> GRANT CONNECT ON DATABASE mydatabase TO dbreadonly;
> GRANT USAGE ON SCHEMA public TO dbreadonly;
> GRANT SELECT ON ALL TABLES IN SCHEMA public TO dbreadonly;
> GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO dbreadonly;
> ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO 
> dbreadonly;
>

Is "public" a good schema to use for this sort of thing, or does it matter?

view thread (10+ messages)  latest in thread

Message-ID: <14f02a5e-4f6d-70a2-3cfb-fb783748c64a@gmail.com>
Permalink:  ../14f02a5e-4f6d-70a2-3cfb-fb783748c64a@gmail.com/
Also on:    postgresql.org/message-id/14f02a5e-4f6d-70a2-3cfb-fb783748c64a@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: robjsargent@gmail.com
  Subject: Re: Read only user permission
  In-Reply-To: <14f02a5e-4f6d-70a2-3cfb-fb783748c64a@gmail.com>
  References: <BLAPR17MB419317757B0A5D24F5076CBCD21CA@BLAPR17MB4193.namprd17.prod.outlook.com> <2050922589.351126.1692813073578@office.mailbox.org> <BLAPR17MB419337242CDCB04453E54D10D21CA@BLAPR17MB4193.namprd17.prod.outlook.com> <14f02a5e-4f6d-70a2-3cfb-fb783748c64a@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