mirror of
https://github.com/postgres/postgres.git
synced 2025-12-22 17:42:17 +03:00
Add REPLICATION privilege for ROLEs
This privilege is required to do Streaming Replication, instead of superuser, making it possible to set up a SR slave that doesn't have write permissions on the master. Superuser privileges do NOT override this check, so in order to use the default superuser account for replication it must be explicitly granted the REPLICATION permissions. This is backwards incompatible change, in the interest of higher default security.
This commit is contained in:
@@ -31,6 +31,7 @@ ALTER ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replace
|
||||
| CREATEUSER | NOCREATEUSER
|
||||
| INHERIT | NOINHERIT
|
||||
| LOGIN | NOLOGIN
|
||||
| REPLICATION | NOREPLICATION
|
||||
| CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>
|
||||
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
||||
| VALID UNTIL '<replaceable class="PARAMETER">timestamp</replaceable>'
|
||||
@@ -63,7 +64,7 @@ ALTER ROLE <replaceable class="PARAMETER">name</replaceable> [ IN DATABASE <repl
|
||||
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 roles.
|
||||
settings, but only for non-superuser and non-replication roles.
|
||||
Ordinary roles can only change their own password.
|
||||
</para>
|
||||
|
||||
@@ -127,6 +128,8 @@ ALTER ROLE <replaceable class="PARAMETER">name</replaceable> [ IN DATABASE <repl
|
||||
<term><literal>NOINHERIT</literal></term>
|
||||
<term><literal>LOGIN</literal></term>
|
||||
<term><literal>NOLOGIN</literal></term>
|
||||
<term><literal>REPLICATION</literal></term>
|
||||
<term><literal>NOREPLICATION</literal></term>
|
||||
<term><literal>CONNECTION LIMIT</literal> <replaceable class="parameter">connlimit</replaceable></term>
|
||||
<term><literal>PASSWORD</> <replaceable class="parameter">password</replaceable></term>
|
||||
<term><literal>ENCRYPTED</></term>
|
||||
|
||||
@@ -31,6 +31,7 @@ ALTER USER <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replace
|
||||
| CREATEUSER | NOCREATEUSER
|
||||
| INHERIT | NOINHERIT
|
||||
| LOGIN | NOLOGIN
|
||||
| REPLICATION | NOREPLICATION
|
||||
| CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>
|
||||
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
||||
| VALID UNTIL '<replaceable class="PARAMETER">timestamp</replaceable>'
|
||||
|
||||
@@ -31,6 +31,7 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
|
||||
| CREATEUSER | NOCREATEUSER
|
||||
| INHERIT | NOINHERIT
|
||||
| LOGIN | NOLOGIN
|
||||
| REPLICATION | NOREPLICATION
|
||||
| CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>
|
||||
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
||||
| VALID UNTIL '<replaceable class="PARAMETER">timestamp</replaceable>'
|
||||
@@ -174,6 +175,21 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>REPLICATION</literal></term>
|
||||
<term><literal>NOREPLICATION</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
These clauses determine whether a role is allowed to initiate
|
||||
streaming replication or put the system in and out of backup mode.
|
||||
A role having the <literal>REPLICATION</> attribute is a very
|
||||
highly privileged role, and should only be used on roles actually
|
||||
used for replication. If not specified,
|
||||
<literal>NOREPLICATION</literal> is the default.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>CONNECTION LIMIT</literal> <replaceable class="parameter">connlimit</replaceable></term>
|
||||
<listitem>
|
||||
|
||||
@@ -31,6 +31,7 @@ CREATE USER <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
|
||||
| CREATEUSER | NOCREATEUSER
|
||||
| INHERIT | NOINHERIT
|
||||
| LOGIN | NOLOGIN
|
||||
| REPLICATION | NOREPLICATION
|
||||
| CONNECTION LIMIT <replaceable class="PARAMETER">connlimit</replaceable>
|
||||
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
|
||||
| VALID UNTIL '<replaceable class="PARAMETER">timestamp</replaceable>'
|
||||
|
||||
Reference in New Issue
Block a user