mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +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:
@@ -510,8 +510,9 @@ static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_
|
||||
MAPPING MATCH MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE
|
||||
|
||||
NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NOCREATEDB
|
||||
NOCREATEROLE NOCREATEUSER NOINHERIT NOLOGIN_P NONE NOSUPERUSER
|
||||
NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF NULLS_P NUMERIC
|
||||
NOCREATEROLE NOCREATEUSER NOINHERIT NOLOGIN_P NONE NOREPLICATION_P
|
||||
NOSUPERUSER NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
|
||||
NULLS_P NUMERIC
|
||||
|
||||
OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR
|
||||
ORDER OUT_P OUTER_P OVER OVERLAPS OVERLAY OWNED OWNER
|
||||
@@ -523,8 +524,9 @@ static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_
|
||||
QUOTE
|
||||
|
||||
RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REINDEX
|
||||
RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA RESET RESTART
|
||||
RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROW ROWS RULE
|
||||
RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA REPLICATION_P
|
||||
RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK
|
||||
ROW ROWS RULE
|
||||
|
||||
SAVEPOINT SCHEMA SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES
|
||||
SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE
|
||||
@@ -864,6 +866,14 @@ AlterOptRoleElem:
|
||||
{
|
||||
$$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE));
|
||||
}
|
||||
| REPLICATION_P
|
||||
{
|
||||
$$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE));
|
||||
}
|
||||
| NOREPLICATION_P
|
||||
{
|
||||
$$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE));
|
||||
}
|
||||
| CONNECTION LIMIT SignedIconst
|
||||
{
|
||||
$$ = makeDefElem("connectionlimit", (Node *)makeInteger($3));
|
||||
@@ -11288,6 +11298,7 @@ unreserved_keyword:
|
||||
| NOCREATEUSER
|
||||
| NOINHERIT
|
||||
| NOLOGIN_P
|
||||
| NOREPLICATION_P
|
||||
| NOSUPERUSER
|
||||
| NOTHING
|
||||
| NOTIFY
|
||||
@@ -11330,6 +11341,7 @@ unreserved_keyword:
|
||||
| REPEATABLE
|
||||
| REPLACE
|
||||
| REPLICA
|
||||
| REPLICATION_P
|
||||
| RESET
|
||||
| RESTART
|
||||
| RESTRICT
|
||||
|
Reference in New Issue
Block a user