diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-10-22 09:33:51 -0700 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-10-22 09:34:03 -0700 |
commit | d371bebd3d16949171282c8252dfd6f82d2e7378 (patch) | |
tree | 2c91b823d26ca11e7c89d86114a1c3c80f8527b2 /src | |
parent | bde39eed0cafb82bc94c40e95d96b5cf47b6f719 (diff) | |
download | postgresql-d371bebd3d16949171282c8252dfd6f82d2e7378.tar.gz postgresql-d371bebd3d16949171282c8252dfd6f82d2e7378.zip |
Remove redundant CREATEUSER/NOCREATEUSER options in CREATE ROLE et al.
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/parser/gram.y | 10 | ||||
-rw-r--r-- | src/backend/utils/mb/conversion_procs/regress_prolog | 2 | ||||
-rw-r--r-- | src/bin/psql/tab-complete.c | 16 | ||||
-rw-r--r-- | src/test/regress/expected/conversion.out | 2 | ||||
-rw-r--r-- | src/test/regress/sql/conversion.sql | 2 |
5 files changed, 11 insertions, 21 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 8bd511952c9..fba91d53ac3 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -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) diff --git a/src/backend/utils/mb/conversion_procs/regress_prolog b/src/backend/utils/mb/conversion_procs/regress_prolog index f5c71790cf2..f35241a2d09 100644 --- a/src/backend/utils/mb/conversion_procs/regress_prolog +++ b/src/backend/utils/mb/conversion_procs/regress_prolog @@ -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; -- diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 4eb5058416c..0e8d3951a29 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -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}; diff --git a/src/test/regress/expected/conversion.out b/src/test/regress/expected/conversion.out index 13f1cf3447b..96ea3b9e190 100644 --- a/src/test/regress/expected/conversion.out +++ b/src/test/regress/expected/conversion.out @@ -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; -- diff --git a/src/test/regress/sql/conversion.sql b/src/test/regress/sql/conversion.sql index e27f06f5c75..fb184453c24 100644 --- a/src/test/regress/sql/conversion.sql +++ b/src/test/regress/sql/conversion.sql @@ -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; -- |