summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 6376d430870..ce00f4032ee 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -589,8 +589,21 @@ PostmasterMain(int argc, char *argv[])
output_config_variable = strdup(optarg);
break;
- case 'c':
case '-':
+
+ /*
+ * Error if the user misplaced a special must-be-first option
+ * for dispatching to a subprogram. parse_dispatch_option()
+ * returns DISPATCH_POSTMASTER if it doesn't find a match, so
+ * error for anything else.
+ */
+ if (parse_dispatch_option(optarg) != DISPATCH_POSTMASTER)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("--%s must be first argument", optarg)));
+
+ /* FALLTHROUGH */
+ case 'c':
{
char *name,
*value;