Alter default privileges vs new schemas - Mailing list pgsql-general

From Francisco Reyes
Subject Alter default privileges vs new schemas
Date
Msg-id 598bc8e4-2a51-11bb-5219-04c6923ba98f@natserv.net
Whole thread Raw
List pgsql-general
https://www.postgresql.org/docs/current/static/sql-alterdefaultprivileges.html

Have a client where their development teams use extensive use of
schemas. We use default privileges like this

ALTER DEFAULT PRIVILEGES FOR ROLE jobs_owner_local GRANT SELECT ON
tables    TO ro_group;
ALTER DEFAULT PRIVILEGES FOR ROLE jobs_owner_local GRANT SELECT ON
sequences TO ro_group;

ALTER DEFAULT PRIVILEGES FOR ROLE jobs_owner_local GRANT SELECT, UPDATE,
DELETE, INSERT ON tables    TO rw_group;
ALTER DEFAULT PRIVILEGES FOR ROLE jobs_owner_local GRANT SELECT,
USAGE                  ON sequences TO rw_group;
ALTER DEFAULT PRIVILEGES FOR ROLE jobs_owner_local GRANT
EXECUTE                        ON functions TO rw_group;


But I can't find a way to grant usage on new schemas. At DB creation I do

grant usage on schema public to rw_group;
grant usage on schema public to ro_group;


Because we revoke everything from public we have to explicitly grant
connect to DB and usage on schemas.


Currently having to manually grant usage when a new schema is created
and wondering if there is a better way.


Postgresql 9.3



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Forward declaration of table
Next
From: Adrian Klaver
Date:
Subject: Re: Forward declaration of table