summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-11-03 15:41:32 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-11-03 15:41:32 -0500
commitdf4405b7848599311c5799f48caba1605490f2b2 (patch)
tree173d98a675ec24bc45d91d1db4b16d0b8aa6df75 /doc/src
parent7827497ba2e64fad80d44841758c2ec101f099f9 (diff)
Allow users with BYPASSRLS to alter their own passwords.
The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other properties of a BYPASSRLS role should be changeable under the same rules as for a normal role, though. Fix that, and also take care of some documentation omissions related to BYPASSRLS and REPLICATION role properties. Tom Lane and Stephen Frost, per bug report from Wolfgang Walther. Back-patch to all supported branches. Discussion: https://postgr.es/m/a5548a9f-89ee-3167-129d-162b5985fcf8@technowledgy.de
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/alter_role.sgml6
-rw-r--r--doc/src/sgml/ref/create_role.sgml11
2 files changed, 13 insertions, 4 deletions
diff --git a/doc/src/sgml/ref/alter_role.sgml b/doc/src/sgml/ref/alter_role.sgml
index ccdd5c107ca..0c90c74245e 100644
--- a/doc/src/sgml/ref/alter_role.sgml
+++ b/doc/src/sgml/ref/alter_role.sgml
@@ -69,8 +69,10 @@ ALTER ROLE { <replaceable class="PARAMETER">role_specification</replaceable> | A
<xref linkend="SQL-REVOKE"> for that.)
Attributes not mentioned in the command retain their previous settings.
Database superusers can change any of these settings for any role.
- Roles having <literal>CREATEROLE</> privilege can change any of these
- settings, but only for non-superuser and non-replication roles.
+ Roles having <literal>CREATEROLE</literal> privilege can change any of these
+ settings except <literal>SUPERUSER</literal>, <literal>REPLICATION</literal>,
+ and <literal>BYPASSRLS</literal>; but only for non-superuser and
+ non-replication roles.
Ordinary roles can only change their own password.
</para>
diff --git a/doc/src/sgml/ref/create_role.sgml b/doc/src/sgml/ref/create_role.sgml
index 36772b678a8..e048757d77b 100644
--- a/doc/src/sgml/ref/create_role.sgml
+++ b/doc/src/sgml/ref/create_role.sgml
@@ -176,6 +176,8 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
highly privileged role, and should only be used on roles actually
used for replication. If not specified,
<literal>NOREPLICATION</literal> is the default.
+ You must be a superuser to create a new role having the
+ <literal>REPLICATION</literal> attribute.
</para>
</listitem>
</varlistentry>
@@ -187,11 +189,16 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
<para>
These clauses determine whether a role bypasses every row-level
security (RLS) policy. <literal>NOBYPASSRLS</literal> is the default.
+ You must be a superuser to create a new role having
+ the <literal>BYPASSRLS</literal> attribute.
+ </para>
+
+ <para>
Note that pg_dump will set <literal>row_security</literal> to
<literal>OFF</literal> by default, to ensure all contents of a table are
dumped out. If the user running pg_dump does not have appropriate
- permissions, an error will be returned. The superuser and owner of the
- table being dumped always bypass RLS.
+ permissions, an error will be returned. However, superusers and the
+ owner of the table being dumped always bypass RLS.
</para>
</listitem>
</varlistentry>