1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Make superuser imply replication privilege. The idea of a privilege that

superuser doesn't have doesn't make much sense, as a superuser can do
whatever he wants through other means, anyway. So instead of granting
replication privilege to superusers in CREATE USER time by default, allow
replication connection from superusers whether or not they have the
replication privilege.

Patch by Noah Misch, per discussion on bug report #6264
This commit is contained in:
Heikki Linnakangas
2012-01-14 18:22:16 +02:00
parent ea038d65c2
commit 00c5f55061
8 changed files with 32 additions and 56 deletions

View File

@ -239,16 +239,7 @@ 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 (issuper && !(disreplication && intVal(disreplication->arg) == 0))
isreplication = 1;
}
if (dinherit)
inherit = intVal(dinherit->arg) != 0;
if (dcreaterole)