From 66a8a0428db046d725b88c8b956384c2a4b4a11c Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 5 Jan 2011 14:24:17 +0100 Subject: 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). --- src/backend/commands/user.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/backend/commands/user.c') diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 9e505b7525f..be049cb9945 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -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) -- cgit v1.2.3