Re: Read only user permission

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Read only user permission
Date: 2023-08-24 02:12:34
Message-ID: 14f02a5e-4f6d-70a2-3cfb-fb783748c64a@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tushar Takate 2023-08-24 05:38:39 Re: PostgreSQL DB cluster migration from centos7/RHEL7/OEL7 to RHEL8
Previous Message Hellen Jiang 2023-08-23 19:23:34 Re: Read only user permission