Folks, I'd like to $Subject for 12.
There are scripts it could break, but not ones that weren't already broken in ways important to access control. What say? Best, David. -- David Fetter <david(at)fetter(dot)org> http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
>From f3382131fd2172eed32052231d4d4ec968bd2c6d Mon Sep 17 00:00:00 2001 From: David Fetter <da...@fetter.org> Date: Sat, 21 Jul 2018 14:26:59 -0700 Subject: [PATCH] Remove the -W option from psql (v01) To: pgsql-hack...@postgresql.org EFOOTGUN --- doc/src/sgml/ref/psql-ref.sgml | 25 ------------------------- src/bin/psql/help.c | 1 - src/bin/psql/startup.c | 6 +----- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index b17039d60f..c0ef7102d0 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -503,31 +503,6 @@ EOF </listitem> </varlistentry> - <varlistentry> - <term><option>-W</option></term> - <term><option>--password</option></term> - <listitem> - <para> - Force <application>psql</application> to prompt for a - password before connecting to a database. - </para> - - <para> - This option is never essential, since <application>psql</application> - will automatically prompt for a password if the server demands - password authentication. However, <application>psql</application> - will waste a connection attempt finding out that the server wants a - password. In some cases it is worth typing <option>-W</option> to avoid - the extra connection attempt. - </para> - - <para> - Note that this option will remain set for the entire session, - and so it affects uses of the meta-command - <command>\connect</command> as well as the initial connection attempt. - </para> - </listitem> - </varlistentry> <varlistentry> <term><option>-x</option></term> diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 702e742af4..cd7614364c 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -138,7 +138,6 @@ usage(unsigned short int pager) env = user; fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), env); fprintf(output, _(" -w, --no-password never prompt for password\n")); - fprintf(output, _(" -W, --password force password prompt (should happen automatically)\n")); fprintf(output, _("\nFor more information, type \"\\?\" (for internal commands) or \"\\help\" (for SQL\n" "commands) from within psql, or consult the psql section in the PostgreSQL\n" diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index be57574cd3..432a583583 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -464,7 +464,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts *options) {"variable", required_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, {"no-password", no_argument, NULL, 'w'}, - {"password", no_argument, NULL, 'W'}, {"expanded", no_argument, NULL, 'x'}, {"no-psqlrc", no_argument, NULL, 'X'}, {"help", optional_argument, NULL, 1}, @@ -476,7 +475,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts *options) memset(options, 0, sizeof *options); - while ((c = getopt_long(argc, argv, "aAbc:d:eEf:F:h:HlL:no:p:P:qR:sStT:U:v:VwWxXz?01", + while ((c = getopt_long(argc, argv, "aAbc:d:eEf:F:h:HlL:no:p:P:qR:sStT:U:v:VwxXz?01", long_options, &optindex)) != -1) { switch (c) @@ -615,9 +614,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts *options) case 'w': pset.getPassword = TRI_NO; break; - case 'W': - pset.getPassword = TRI_YES; - break; case 'x': pset.popt.topt.expanded = true; break; -- 2.17.1