Re: Read only user permission - Mailing list pgsql-general

From Rob Sargent
Subject Re: Read only user permission
Date
Msg-id 14f02a5e-4f6d-70a2-3cfb-fb783748c64a@gmail.com
Whole thread Raw
In response to Re: Read only user permission  (Hellen Jiang <hjiang@federatedwireless.com>)
List pgsql-general
On 8/23/23 13:23, Hellen Jiang wrote:
@font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face {font-family:DengXian; panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face {font-family:"\@DengXian"; panose-1:2 1 6 0 3 1 1 1 1 1;}p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; font-size:10.0pt; font-family:"Calibri",sans-serif;}span.EmailStyle19 {mso-style-type:personal-reply; font-family:"Calibri",sans-serif; color:windowtext;}.MsoChpDefault {mso-style-type:export-only; font-size:10.0pt; mso-ligatures:none;}div.WordSection1 {page:WordSection1;}

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?

pgsql-general by date:

Previous
From: Hellen Jiang
Date:
Subject: Re: Read only user permission
Next
From: Tushar Takate
Date:
Subject: Re: PostgreSQL DB cluster migration from centos7/RHEL7/OEL7 to RHEL8