Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c5eb835

Browse files
committed
Remove ancient -X options to pg_dump, pg_dumpall, pg_restore.
The last version in which these options were documented is now EOL, so it's time to get rid of them for real. We now use GNU-style long options instead.
1 parent 777e8c0 commit c5eb835

File tree

3 files changed

+2
-72
lines changed

3 files changed

+2
-72
lines changed

src/bin/pg_dump/pg_dump.c

+1-24
Original file line numberDiff line numberDiff line change
@@ -468,35 +468,12 @@ main(int argc, char **argv)
468468
aclsSkip = true;
469469
break;
470470

471-
case 'X':
472-
/*
473-
* -X is a deprecated alternative to long options;
474-
* no new -X options are to be added.
475-
*/
476-
if (strcmp(optarg, "disable-dollar-quoting") == 0)
477-
disable_dollar_quoting = 1;
478-
else if (strcmp(optarg, "disable-triggers") == 0)
479-
disable_triggers = 1;
480-
else if (strcmp(optarg, "no-tablespaces") == 0)
481-
outputNoTablespaces = 1;
482-
else if (strcmp(optarg, "use-set-session-authorization") == 0)
483-
use_setsessauth = 1;
484-
else
485-
{
486-
fprintf(stderr,
487-
_("%s: invalid -X option -- %s\n"),
488-
progname, optarg);
489-
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
490-
exit(1);
491-
}
492-
break;
493-
494471
case 'Z': /* Compression Level */
495472
compressLevel = atoi(optarg);
496473
break;
497474

498475
case 0:
499-
/* This covers the long options equivalent to -X xxx. */
476+
/* This covers the long options. */
500477
break;
501478

502479
case 2: /* lock-wait-timeout */

src/bin/pg_dump/pg_dumpall.c

-24
Original file line numberDiff line numberDiff line change
@@ -280,30 +280,6 @@ main(int argc, char *argv[])
280280
appendPQExpBuffer(pgdumpopts, " -x");
281281
break;
282282

283-
case 'X':
284-
/* -X is a deprecated alternative to long options */
285-
if (strcmp(optarg, "disable-dollar-quoting") == 0)
286-
disable_dollar_quoting = 1;
287-
else if (strcmp(optarg, "disable-triggers") == 0)
288-
disable_triggers = 1;
289-
else if (strcmp(optarg, "no-tablespaces") == 0)
290-
no_tablespaces = 1;
291-
else if (strcmp(optarg, "use-set-session-authorization") == 0)
292-
use_setsessauth = 1;
293-
else if (strcmp(optarg, "no-security-label") == 0)
294-
no_security_label = 1;
295-
else if (strcmp(optarg, "no-unlogged-table-data") == 0)
296-
no_unlogged_table_data = 1;
297-
else
298-
{
299-
fprintf(stderr,
300-
_("%s: invalid -X option -- %s\n"),
301-
progname, optarg);
302-
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
303-
exit(1);
304-
}
305-
break;
306-
307283
case 0:
308284
break;
309285

src/bin/pg_dump/pg_restore.c

+1-24
Original file line numberDiff line numberDiff line change
@@ -254,28 +254,6 @@ main(int argc, char **argv)
254254
opts->aclsSkip = 1;
255255
break;
256256

257-
case 'X':
258-
/* -X is a deprecated alternative to long options */
259-
if (strcmp(optarg, "disable-triggers") == 0)
260-
disable_triggers = 1;
261-
else if (strcmp(optarg, "no-data-for-failed-tables") == 0)
262-
no_data_for_failed_tables = 1;
263-
else if (strcmp(optarg, "no-tablespaces") == 0)
264-
outputNoTablespaces = 1;
265-
else if (strcmp(optarg, "use-set-session-authorization") == 0)
266-
use_setsessauth = 1;
267-
else if (strcmp(optarg, "no-security-label") == 0)
268-
skip_seclabel = 1;
269-
else
270-
{
271-
fprintf(stderr,
272-
_("%s: invalid -X option -- %s\n"),
273-
progname, optarg);
274-
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
275-
exit(1);
276-
}
277-
break;
278-
279257
case '1': /* Restore data in a single transaction */
280258
opts->single_txn = true;
281259
opts->exit_on_error = true;
@@ -284,8 +262,7 @@ main(int argc, char **argv)
284262
case 0:
285263

286264
/*
287-
* This covers the long options without a short equivalent,
288-
* including those equivalent to -X xxx.
265+
* This covers the long options without a short equivalent.
289266
*/
290267
break;
291268

0 commit comments

Comments
 (0)