mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Give superusers REPLIACTION permission by default
This can be overriden by using NOREPLICATION on the CREATE ROLE statement, but by default they will have it, making it backwards compatible and "less surprising" (given that superusers normally override all checks).
This commit is contained in:
@ -248,7 +248,15 @@ CreateRole(CreateRoleStmt *stmt)
|
||||
if (dpassword && dpassword->arg)
|
||||
password = strVal(dpassword->arg);
|
||||
if (dissuper)
|
||||
{
|
||||
issuper = intVal(dissuper->arg) != 0;
|
||||
/*
|
||||
* Superusers get replication by default, but only if
|
||||
* NOREPLICATION wasn't explicitly mentioned
|
||||
*/
|
||||
if (!(disreplication && intVal(disreplication->arg) == 0))
|
||||
isreplication = 1;
|
||||
}
|
||||
if (dinherit)
|
||||
inherit = intVal(dinherit->arg) != 0;
|
||||
if (dcreaterole)
|
||||
|
Reference in New Issue
Block a user