mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +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)
|
||||
|
@ -53,6 +53,6 @@
|
||||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 201101031
|
||||
#define CATALOG_VERSION_NO 201101051
|
||||
|
||||
#endif
|
||||
|
@ -93,7 +93,7 @@ typedef FormData_pg_authid *Form_pg_authid;
|
||||
* user choices.
|
||||
* ----------------
|
||||
*/
|
||||
DATA(insert OID = 10 ( "POSTGRES" t t t t t t f -1 _null_ _null_ ));
|
||||
DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_ ));
|
||||
|
||||
#define BOOTSTRAP_SUPERUSERID 10
|
||||
|
||||
|
Reference in New Issue
Block a user