Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd371beb

Browse files
committed
Remove redundant CREATEUSER/NOCREATEUSER options in CREATE ROLE et al.
Once upon a time we did not have a separate CREATEROLE privilege, andCREATEUSER effectively meant SUPERUSER. When we invented CREATEROLE(in 8.1) we also added SUPERUSER so as to have a less confusing keywordfor this role property. However, we left CREATEUSER in place as adeprecated synonym for SUPERUSER, because of backwards-compatibilityconcerns. It's still there and is still confusing people, as for examplein 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 justremove these old keywords. Hence, do so.
1 parentbde39ee commitd371beb

File tree

10 files changed

+11
-41
lines changed

10 files changed

+11
-41
lines changed

‎doc/src/sgml/ref/alter_role.sgml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ ALTER ROLE <replaceable class="PARAMETER">role_specification</replaceable> [ WIT
2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB
3030
| CREATEROLE | NOCREATEROLE
31-
| CREATEUSER | NOCREATEUSER
3231
| INHERIT | NOINHERIT
3332
| LOGIN | NOLOGIN
3433
| REPLICATION | NOREPLICATION
@@ -160,8 +159,6 @@ ALTER ROLE { <replaceable class="PARAMETER">role_specification</replaceable> | A
160159
<term><literal>NOCREATEDB</></term>
161160
<term><literal>CREATEROLE</literal></term>
162161
<term><literal>NOCREATEROLE</literal></term>
163-
<term><literal>CREATEUSER</literal></term>
164-
<term><literal>NOCREATEUSER</literal></term>
165162
<term><literal>INHERIT</literal></term>
166163
<term><literal>NOINHERIT</literal></term>
167164
<term><literal>LOGIN</literal></term>

‎doc/src/sgml/ref/alter_user.sgml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ ALTER USER <replaceable class="PARAMETER">role_specification</replaceable> [ WIT
2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB
3030
| CREATEROLE | NOCREATEROLE
31-
| CREATEUSER | NOCREATEUSER
3231
| INHERIT | NOINHERIT
3332
| LOGIN | NOLOGIN
3433
| REPLICATION | NOREPLICATION

‎doc/src/sgml/ref/create_group.sgml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CREATE GROUP <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <repla
2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB
3030
| CREATEROLE | NOCREATEROLE
31-
| CREATEUSER | NOCREATEUSER
3231
| INHERIT | NOINHERIT
3332
| LOGIN | NOLOGIN
3433
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'

‎doc/src/sgml/ref/create_role.sgml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB
3030
| CREATEROLE | NOCREATEROLE
31-
| CREATEUSER | NOCREATEUSER
3231
| INHERIT | NOINHERIT
3332
| LOGIN | NOLOGIN
3433
| REPLICATION | NOREPLICATION
@@ -124,19 +123,6 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
124123
</listitem>
125124
</varlistentry>
126125

127-
<varlistentry>
128-
<term><literal>CREATEUSER</literal></term>
129-
<term><literal>NOCREATEUSER</literal></term>
130-
<listitem>
131-
<para>
132-
These clauses are an obsolete, but still accepted, spelling of
133-
<literal>SUPERUSER</literal> and <literal>NOSUPERUSER</literal>.
134-
Note that they are <emphasis>not</> equivalent to
135-
<literal>CREATEROLE</literal> as one might naively expect!
136-
</para>
137-
</listitem>
138-
</varlistentry>
139-
140126
<varlistentry>
141127
<term><literal>INHERIT</literal></term>
142128
<term><literal>NOINHERIT</literal></term>

‎doc/src/sgml/ref/create_user.sgml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CREATE USER <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
2828
SUPERUSER | NOSUPERUSER
2929
| CREATEDB | NOCREATEDB
3030
| CREATEROLE | NOCREATEROLE
31-
| CREATEUSER | NOCREATEUSER
3231
| INHERIT | NOINHERIT
3332
| LOGIN | NOLOGIN
3433
| REPLICATION | NOREPLICATION

‎src/backend/parser/gram.y

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -966,16 +966,6 @@ AlterOptRoleElem:
966966
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
967967
elseif (strcmp($1,"nosuperuser") ==0)
968968
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
969-
elseif (strcmp($1,"createuser") ==0)
970-
{
971-
/* For backwards compatibility, synonym for SUPERUSER*/
972-
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
973-
}
974-
elseif (strcmp($1,"nocreateuser") ==0)
975-
{
976-
/* For backwards compatibility, synonym for SUPERUSER*/
977-
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
978-
}
979969
elseif (strcmp($1,"createrole") ==0)
980970
$$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
981971
elseif (strcmp($1,"nocreaterole") ==0)

‎src/backend/utils/mb/conversion_procs/regress_prolog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--
22
-- create user defined conversion
33
--
4-
CREATE USER conversion_test_user WITH NOCREATEDBNOCREATEUSER;
4+
CREATE USER conversion_test_user WITH NOCREATEDBNOCREATEROLE;
55
SET SESSION AUTHORIZATION conversion_test_user;
66
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
77
--

‎src/bin/psql/tab-complete.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,8 @@ psql_completion(const char *text, int start, int end)
12641264
{
12651265
staticconstchar*constlist_ALTERUSER[]=
12661266
{"BYPASSRLS","CONNECTION LIMIT","CREATEDB","CREATEROLE",
1267-
"CREATEUSER","ENCRYPTED","INHERIT","LOGIN","NOBYPASSRLS",
1268-
"NOCREATEDB","NOCREATEROLE","NOCREATEUSER","NOINHERIT",
1267+
"ENCRYPTED","INHERIT","LOGIN","NOBYPASSRLS",
1268+
"NOCREATEDB","NOCREATEROLE","NOINHERIT",
12691269
"NOLOGIN","NOREPLICATION","NOSUPERUSER","PASSWORD","RENAME TO",
12701270
"REPLICATION","RESET","SET","SUPERUSER","UNENCRYPTED",
12711271
"VALID UNTIL","WITH",NULL};
@@ -1282,8 +1282,8 @@ psql_completion(const char *text, int start, int end)
12821282
/* Similar to the above, but don't complete "WITH" again. */
12831283
staticconstchar*constlist_ALTERUSER_WITH[]=
12841284
{"BYPASSRLS","CONNECTION LIMIT","CREATEDB","CREATEROLE",
1285-
"CREATEUSER","ENCRYPTED","INHERIT","LOGIN","NOBYPASSRLS",
1286-
"NOCREATEDB","NOCREATEROLE","NOCREATEUSER","NOINHERIT",
1285+
"ENCRYPTED","INHERIT","LOGIN","NOBYPASSRLS",
1286+
"NOCREATEDB","NOCREATEROLE","NOINHERIT",
12871287
"NOLOGIN","NOREPLICATION","NOSUPERUSER","PASSWORD","RENAME TO",
12881288
"REPLICATION","RESET","SET","SUPERUSER","UNENCRYPTED",
12891289
"VALID UNTIL",NULL};
@@ -2671,8 +2671,8 @@ psql_completion(const char *text, int start, int end)
26712671
{
26722672
staticconstchar*constlist_CREATEROLE[]=
26732673
{"ADMIN","BYPASSRLS","CONNECTION LIMIT","CREATEDB","CREATEROLE",
2674-
"CREATEUSER","ENCRYPTED","IN","INHERIT","LOGIN","NOBYPASSRLS",
2675-
"NOCREATEDB","NOCREATEROLE","NOCREATEUSER","NOINHERIT",
2674+
"ENCRYPTED","IN","INHERIT","LOGIN","NOBYPASSRLS",
2675+
"NOCREATEDB","NOCREATEROLE","NOINHERIT",
26762676
"NOLOGIN","NOREPLICATION","NOSUPERUSER","PASSWORD",
26772677
"REPLICATION","ROLE","SUPERUSER","SYSID","UNENCRYPTED",
26782678
"VALID UNTIL","WITH",NULL};
@@ -2690,8 +2690,8 @@ psql_completion(const char *text, int start, int end)
26902690
/* Similar to the above, but don't complete "WITH" again. */
26912691
staticconstchar*constlist_CREATEROLE_WITH[]=
26922692
{"ADMIN","BYPASSRLS","CONNECTION LIMIT","CREATEDB","CREATEROLE",
2693-
"CREATEUSER","ENCRYPTED","IN","INHERIT","LOGIN","NOBYPASSRLS",
2694-
"NOCREATEDB","NOCREATEROLE","NOCREATEUSER","NOINHERIT",
2693+
"ENCRYPTED","IN","INHERIT","LOGIN","NOBYPASSRLS",
2694+
"NOCREATEDB","NOCREATEROLE","NOINHERIT",
26952695
"NOLOGIN","NOREPLICATION","NOSUPERUSER","PASSWORD",
26962696
"REPLICATION","ROLE","SUPERUSER","SYSID","UNENCRYPTED",
26972697
"VALID UNTIL",NULL};

‎src/test/regress/expected/conversion.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SET bytea_output TO escape;
33
--
44
-- create user defined conversion
55
--
6-
CREATE USER conversion_test_user WITH NOCREATEDBNOCREATEUSER;
6+
CREATE USER conversion_test_user WITH NOCREATEDBNOCREATEROLE;
77
SET SESSION AUTHORIZATION conversion_test_user;
88
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
99
--

‎src/test/regress/sql/conversion.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SET bytea_output TO escape;
44
--
55
-- create user defined conversion
66
--
7-
CREATEUSERconversion_test_user WITH NOCREATEDBNOCREATEUSER;
7+
CREATEUSERconversion_test_user WITH NOCREATEDBNOCREATEROLE;
88
SET SESSION AUTHORIZATION conversion_test_user;
99
CREATECONVERSIONmyconv FOR'LATIN1' TO'UTF8'FROM iso8859_1_to_utf8;
1010
--

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp