]> granicus.if.org Git - postgresql/commitdiff
Don't handle PUBLIC/NONE separately
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 20 Jul 2015 16:47:15 +0000 (18:47 +0200)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 20 Jul 2015 16:47:15 +0000 (18:47 +0200)
Since those role specifiers are checked in the grammar, there's no need
for the old checks to remain in place after 31eae6028ec.  Remove them.

Backpatch to 9.5.

Noted and patch by Jeevan Chalke

src/backend/commands/user.c

index 5b20994028db94ded295573414db4e007e45998b..afbf2763be6000ce0cc97ebc5cf8686fc76491ed 100644 (file)
@@ -311,13 +311,6 @@ CreateRole(CreateRoleStmt *stmt)
                                         errmsg("permission denied to create role")));
        }
 
-       if (strcmp(stmt->role, "public") == 0 ||
-               strcmp(stmt->role, "none") == 0)
-               ereport(ERROR,
-                               (errcode(ERRCODE_RESERVED_NAME),
-                                errmsg("role name \"%s\" is reserved",
-                                               stmt->role)));
-
        /*
         * Check the pg_authid relation to be certain the role doesn't already
         * exist.
@@ -1159,13 +1152,6 @@ RenameRole(const char *oldname, const char *newname)
                                (errcode(ERRCODE_DUPLICATE_OBJECT),
                                 errmsg("role \"%s\" already exists", newname)));
 
-       if (strcmp(newname, "public") == 0 ||
-               strcmp(newname, "none") == 0)
-               ereport(ERROR,
-                               (errcode(ERRCODE_RESERVED_NAME),
-                                errmsg("role name \"%s\" is reserved",
-                                               newname)));
-
        /*
         * createrole is enough privilege unless you want to mess with a superuser
         */