diff options
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index d31a67599c9..a5217773ffc 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -224,8 +224,21 @@ BootstrapModeMain(int argc, char *argv[], bool check_only) case 'B': SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV); 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; |