]> granicus.if.org Git - postgresql/commitdiff
Remove redundant CREATEUSER/NOCREATEUSER options in CREATE ROLE et al.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 22 Oct 2015 16:33:51 +0000 (09:33 -0700)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 22 Oct 2015 16:34:03 +0000 (09:34 -0700)
Once upon a time we did not have a separate CREATEROLE privilege, and
CREATEUSER effectively meant SUPERUSER.  When we invented CREATEROLE
(in 8.1) we also added SUPERUSER so as to have a less confusing keyword
for this role property.  However, we left CREATEUSER in place as a
deprecated synonym for SUPERUSER, because of backwards-compatibility
concerns.  It's still there and is still confusing people, as for example
in bug #13694 from Justin Catterson.  9.6 will be ten years or so later,
which surely ought to be long enough to end the deprecation and just
remove these old keywords.  Hence, do so.

doc/src/sgml/ref/alter_role.sgml
doc/src/sgml/ref/alter_user.sgml
doc/src/sgml/ref/create_group.sgml
doc/src/sgml/ref/create_role.sgml
doc/src/sgml/ref/create_user.sgml
src/backend/parser/gram.y
src/backend/utils/mb/conversion_procs/regress_prolog
src/bin/psql/tab-complete.c
src/test/regress/expected/conversion.out
src/test/regress/sql/conversion.sql

index 7638817b830a1eb73ab59174591fe6eaf3378453..da36ad96967e7c842c28f5787b5ec0dc48ec5a60 100644 (file)
@@ -28,7 +28,6 @@ ALTER ROLE <replaceable class="PARAMETER">role_specification</replaceable> [ WIT
       SUPERUSER | NOSUPERUSER
     | CREATEDB | NOCREATEDB
     | CREATEROLE | NOCREATEROLE
-    | CREATEUSER | NOCREATEUSER
     | INHERIT | NOINHERIT
     | LOGIN | NOLOGIN
     | REPLICATION | NOREPLICATION
@@ -160,8 +159,6 @@ ALTER ROLE { <replaceable class="PARAMETER">role_specification</replaceable> | A
       <term><literal>NOCREATEDB</></term>
       <term><literal>CREATEROLE</literal></term>
       <term><literal>NOCREATEROLE</literal></term>
-      <term><literal>CREATEUSER</literal></term>
-      <term><literal>NOCREATEUSER</literal></term>
       <term><literal>INHERIT</literal></term>
       <term><literal>NOINHERIT</literal></term>
       <term><literal>LOGIN</literal></term>
index 0ffaa16da2fc75fcd1121dcde627837d6a8e9166..84a0c52191fc6c82687ef49df99ac30fdbfd8f1d 100644 (file)
@@ -28,7 +28,6 @@ ALTER USER <replaceable class="PARAMETER">role_specification</replaceable> [ WIT
       SUPERUSER | NOSUPERUSER
     | CREATEDB | NOCREATEDB
     | CREATEROLE | NOCREATEROLE
-    | CREATEUSER | NOCREATEUSER
     | INHERIT | NOINHERIT
     | LOGIN | NOLOGIN
     | REPLICATION | NOREPLICATION
index 981ce51e5f4aa7a4e54ed962c4675c80281137c8..1d5cc9b5969842985fc657c27d3becd3a3f6af0e 100644 (file)
@@ -28,7 +28,6 @@ CREATE GROUP <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <repla
       SUPERUSER | NOSUPERUSER
     | CREATEDB | NOCREATEDB
     | CREATEROLE | NOCREATEROLE
-    | CREATEUSER | NOCREATEUSER
     | INHERIT | NOINHERIT
     | LOGIN | NOLOGIN
     | [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
index 240c21ce85fcd1bd4cddd4bb6af109ef319f8175..38cd4c83696053f5b70fc514e9b3939cb842fb3a 100644 (file)
@@ -28,7 +28,6 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
       SUPERUSER | NOSUPERUSER
     | CREATEDB | NOCREATEDB
     | CREATEROLE | NOCREATEROLE
-    | CREATEUSER | NOCREATEUSER
     | INHERIT | NOINHERIT
     | LOGIN | NOLOGIN
     | REPLICATION | NOREPLICATION
@@ -124,19 +123,6 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
       </listitem>
      </varlistentry>
 
-     <varlistentry>
-      <term><literal>CREATEUSER</literal></term>
-      <term><literal>NOCREATEUSER</literal></term>
-      <listitem>
-       <para>
-        These clauses are an obsolete, but still accepted, spelling of
-        <literal>SUPERUSER</literal> and <literal>NOSUPERUSER</literal>.
-        Note that they are <emphasis>not</> equivalent to
-        <literal>CREATEROLE</literal> as one might naively expect!
-       </para>
-      </listitem>
-     </varlistentry>
-
      <varlistentry>
       <term><literal>INHERIT</literal></term>
       <term><literal>NOINHERIT</literal></term>
index 065999c85a4df610908c1e762d7bc3435406986b..6c690b36df561573f234de073e4ddbb10e6e9ec7 100644 (file)
@@ -28,7 +28,6 @@ CREATE USER <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
       SUPERUSER | NOSUPERUSER
     | CREATEDB | NOCREATEDB
     | CREATEROLE | NOCREATEROLE
-    | CREATEUSER | NOCREATEUSER
     | INHERIT | NOINHERIT
     | LOGIN | NOLOGIN
     | REPLICATION | NOREPLICATION
index 8bd511952c9fd9706bc2c262e7f72154c91f99c6..fba91d53ac3f3e70e5b196ebfbd35efebf55eed3 100644 (file)
@@ -966,16 +966,6 @@ AlterOptRoleElem:
                                                $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
                                        else if (strcmp($1, "nosuperuser") == 0)
                                                $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
-                                       else if (strcmp($1, "createuser") == 0)
-                                       {
-                                               /* For backwards compatibility, synonym for SUPERUSER */
-                                               $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
-                                       }
-                                       else if (strcmp($1, "nocreateuser") == 0)
-                                       {
-                                               /* For backwards compatibility, synonym for SUPERUSER */
-                                               $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
-                                       }
                                        else if (strcmp($1, "createrole") == 0)
                                                $$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
                                        else if (strcmp($1, "nocreaterole") == 0)
index f5c71790cf28cf06a4d3e0c8ff512bd2911d9f22..f35241a2d097918049a858d289b2131b84c4d509 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- create user defined conversion
 --
-CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
+CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
 SET SESSION AUTHORIZATION conversion_test_user;
 CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
 --
index 4eb5058416c1dd3d24463e5511ddea5e6acccd98..0e8d3951a29ff24c1098f9d4acd09e72270d697b 100644 (file)
@@ -1264,8 +1264,8 @@ psql_completion(const char *text, int start, int end)
        {
                static const char *const list_ALTERUSER[] =
                {"BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
-                       "CREATEUSER", "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
-                       "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
+                       "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
+                       "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
                        "NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD", "RENAME TO",
                        "REPLICATION", "RESET", "SET", "SUPERUSER", "UNENCRYPTED",
                "VALID UNTIL", "WITH", NULL};
@@ -1282,8 +1282,8 @@ psql_completion(const char *text, int start, int end)
                /* Similar to the above, but don't complete "WITH" again. */
                static const char *const list_ALTERUSER_WITH[] =
                {"BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
-                       "CREATEUSER", "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
-                       "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
+                       "ENCRYPTED", "INHERIT", "LOGIN", "NOBYPASSRLS",
+                       "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
                        "NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD", "RENAME TO",
                        "REPLICATION", "RESET", "SET", "SUPERUSER", "UNENCRYPTED",
                "VALID UNTIL", NULL};
@@ -2671,8 +2671,8 @@ psql_completion(const char *text, int start, int end)
        {
                static const char *const list_CREATEROLE[] =
                {"ADMIN", "BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
-                       "CREATEUSER", "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
-                       "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
+                       "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
+                       "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
                        "NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD",
                        "REPLICATION", "ROLE", "SUPERUSER", "SYSID", "UNENCRYPTED",
                "VALID UNTIL", "WITH", NULL};
@@ -2690,8 +2690,8 @@ psql_completion(const char *text, int start, int end)
                /* Similar to the above, but don't complete "WITH" again. */
                static const char *const list_CREATEROLE_WITH[] =
                {"ADMIN", "BYPASSRLS", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE",
-                       "CREATEUSER", "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
-                       "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT",
+                       "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOBYPASSRLS",
+                       "NOCREATEDB", "NOCREATEROLE", "NOINHERIT",
                        "NOLOGIN", "NOREPLICATION", "NOSUPERUSER", "PASSWORD",
                        "REPLICATION", "ROLE", "SUPERUSER", "SYSID", "UNENCRYPTED",
                "VALID UNTIL", NULL};
index 13f1cf3447b42c9be8303e7618eee566e44a4b14..96ea3b9e19089253d9d4e23afdb954ac5233e57b 100644 (file)
@@ -3,7 +3,7 @@ SET bytea_output TO escape;
 --
 -- create user defined conversion
 --
-CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
+CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
 SET SESSION AUTHORIZATION conversion_test_user;
 CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
 --
index e27f06f5c7516df6fe83e599afc75546a80d4abd..fb184453c24a92e6eb7ba20a113d3c86038cd246 100644 (file)
@@ -4,7 +4,7 @@ SET bytea_output TO escape;
 --
 -- create user defined conversion
 --
-CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
+CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEROLE;
 SET SESSION AUTHORIZATION conversion_test_user;
 CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
 --