1. First, create a group that will be used for read only access:
create group readonly;
2. Revoke default create rights in the public schema:
revoke create on schema public from group readonly;
3. Grant usage access in the public schema:
grant usage on schema public to group readonly;
4. Grant access to current tables in the public schema:
grant select on all tables in schema public to group readonly;
5. Grant access to future tables in the public schema:
alter default privileges in schema public grant select on tables to group readonly;
6. Create a user:
create user <username> with password '<password>';
7. Associate the new user and group:
alter group readonly add user <username>;
To create additional read only users, repeat steps 6 and 7.