diff options
author | Magnus Hagander <magnus@hagander.net> | 2011-01-05 14:24:17 +0100 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2011-01-05 14:24:17 +0100 |
commit | 66a8a0428db046d725b88c8b956384c2a4b4a11c (patch) | |
tree | f04c0d6946f05f4bc15371c74ac5f8337dc9b50f /src | |
parent | 3302334b48e2be6eb2c01dcf500363dbd4f22e59 (diff) | |
download | postgresql-66a8a0428db046d725b88c8b956384c2a4b4a11c.tar.gz postgresql-66a8a0428db046d725b88c8b956384c2a4b4a11c.zip |
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).
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/user.c | 8 | ||||
-rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_authid.h | 2 |
3 files changed, 10 insertions, 2 deletions
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) diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 2daf9f80ef4..3f5ef242ed2 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201101031 +#define CATALOG_VERSION_NO 201101051 #endif diff --git a/src/include/catalog/pg_authid.h b/src/include/catalog/pg_authid.h index 7eee4cb5cbc..0c5ae443a0d 100644 --- a/src/include/catalog/pg_authid.h +++ b/src/include/catalog/pg_authid.h @@ -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 |