From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_read_all_data and pg_write_all_data roles
Date: Mon, 05 Apr 2021 17:45:12 +0000
Message-ID: <E1lTTHk-0006rH-HD@gemulon.postgresql.org> (raw)
Add pg_read_all_data and pg_write_all_data roles
A commonly requested use-case is to have a role who can run an
unfettered pg_dump without having to explicitly GRANT that user access
to all tables, schemas, et al, without that role being a superuser.
This address that by adding a "pg_read_all_data" role which implicitly
gives any member of this role SELECT rights on all tables, views and
sequences, and USAGE rights on all schemas.
As there may be cases where it's also useful to have a role who has
write access to all objects, pg_write_all_data is also introduced and
gives users implicit INSERT, UPDATE and DELETE rights on all tables,
views and sequences.
These roles can not be logged into directly but instead should be
GRANT'd to a role which is able to log in. As noted in the
documentation, if RLS is being used then an administrator may (or may
not) wish to set BYPASSRLS on the login role which these predefined
roles are GRANT'd to.
Reviewed-by: Georgios Kokolatos
Discussion: https://postgr.es/m/20200828003023.GU29590@tamriel.snowman.net
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6c3ffd697e2242f5497ea4b40fffc8f6f922ff60
Modified Files
--------------
doc/src/sgml/user-manag.sgml | 18 +++++++++++++
src/backend/catalog/aclchk.c | 31 ++++++++++++++++++++++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_authid.dat | 10 +++++++
src/test/regress/expected/privileges.out | 45 +++++++++++++++++++++++++++++++-
src/test/regress/sql/privileges.sql | 25 ++++++++++++++++++
6 files changed, 129 insertions(+), 2 deletions(-)
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-committers@postgresql.org
Cc: sfrost@snowman.net
Subject: Re: pgsql: Add pg_read_all_data and pg_write_all_data roles
In-Reply-To: <E1lTTHk-0006rH-HD@gemulon.postgresql.org>
References: <E1lTTHk-0006rH-HD@gemulon.postgresql.org>
* 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