1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-21 12:05:57 +03:00

Document deprecated createuser option.

2dcd1578c4 left the --role option undocumented, which is
inconsistent with other deprecated options such as pg_dump's
--blobs and --no-blobs.  This change adds --role back to
createuser's documentation and usage output and marks it as
deprecated.

Suggested-by: Peter Eisentraut
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/0e85c9e7-4804-1cdb-5a4a-c72c328f9ad8%40enterprisedb.com
This commit is contained in:
Nathan Bossart 2023-05-23 19:34:09 -07:00
parent be3f62ae6e
commit 381d19b3ea
3 changed files with 4 additions and 3 deletions

View File

@ -150,6 +150,7 @@ PostgreSQL documentation
<varlistentry> <varlistentry>
<term><option>-g <replaceable class="parameter">role</replaceable></option></term> <term><option>-g <replaceable class="parameter">role</replaceable></option></term>
<term><option>--member-of=<replaceable class="parameter">role</replaceable></option></term> <term><option>--member-of=<replaceable class="parameter">role</replaceable></option></term>
<term><option>--role=<replaceable class="parameter">role</replaceable></option> (deprecated)</term>
<listitem> <listitem>
<para> <para>
Specifies the new role should be automatically added as a member Specifies the new role should be automatically added as a member

View File

@ -34,8 +34,7 @@ main(int argc, char *argv[])
{"no-createdb", no_argument, NULL, 'D'}, {"no-createdb", no_argument, NULL, 'D'},
{"echo", no_argument, NULL, 'e'}, {"echo", no_argument, NULL, 'e'},
{"encrypted", no_argument, NULL, 'E'}, {"encrypted", no_argument, NULL, 'E'},
{"role", required_argument, NULL, 'g'}, /* kept for backward {"role", required_argument, NULL, 'g'},
* compatibility */
{"member-of", required_argument, NULL, 'g'}, {"member-of", required_argument, NULL, 'g'},
{"host", required_argument, NULL, 'h'}, {"host", required_argument, NULL, 'h'},
{"inherit", no_argument, NULL, 'i'}, {"inherit", no_argument, NULL, 'i'},
@ -423,6 +422,7 @@ help(const char *progname)
printf(_(" -D, --no-createdb role cannot create databases (default)\n")); printf(_(" -D, --no-createdb role cannot create databases (default)\n"));
printf(_(" -e, --echo show the commands being sent to the server\n")); printf(_(" -e, --echo show the commands being sent to the server\n"));
printf(_(" -g, --member-of=ROLE new role will be a member of ROLE\n")); printf(_(" -g, --member-of=ROLE new role will be a member of ROLE\n"));
printf(_(" --role=ROLE (same as --member-of, deprecated)\n"));
printf(_(" -i, --inherit role inherits privileges of roles it is a\n" printf(_(" -i, --inherit role inherits privileges of roles it is a\n"
" member of (default)\n")); " member of (default)\n"));
printf(_(" -I, --no-inherit role does not inherit privileges\n")); printf(_(" -I, --no-inherit role does not inherit privileges\n"));

View File

@ -71,7 +71,7 @@ $node->issues_sql_like(
$node->issues_sql_like( $node->issues_sql_like(
[ 'createuser', '--role', 'regress_user1', 'regress_user11' ], [ 'createuser', '--role', 'regress_user1', 'regress_user11' ],
qr/statement: CREATE ROLE regress_user11 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS IN ROLE regress_user1;/, qr/statement: CREATE ROLE regress_user11 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS IN ROLE regress_user1;/,
'--role (for backward compatibility)'); '--role');
$node->issues_sql_like( $node->issues_sql_like(
[ 'createuser', '--member-of', 'regress_user1', 'regress_user12' ], [ 'createuser', '--member-of', 'regress_user1', 'regress_user12' ],
qr/statement: CREATE ROLE regress_user12 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS IN ROLE regress_user1;/, qr/statement: CREATE ROLE regress_user12 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS IN ROLE regress_user1;/,