|
105 | 105 | #include "libpq/libpq.h"
|
106 | 106 | #include "libpq/pqformat.h"
|
107 | 107 | #include "libpq/pqsignal.h"
|
108 |
| -#include "miscadmin.h" |
109 | 108 | #include "pg_getopt.h"
|
110 | 109 | #include "pgstat.h"
|
111 | 110 | #include "port/pg_bswap.h"
|
@@ -219,12 +218,6 @@ int ReservedBackends;
|
219 | 218 | /* The socket(s) we're listening to. */
|
220 | 219 | #define MAXLISTEN 64
|
221 | 220 | static pgsocket ListenSocket[MAXLISTEN];
|
222 |
| - |
223 |
| -/* |
224 |
| - * Set by the -o option |
225 |
| - */ |
226 |
| -static char ExtraOptions[MAXPGPATH]; |
227 |
| - |
228 | 221 | /*
|
229 | 222 | * These globals control the behavior of the postmaster in case some
|
230 | 223 | * backend dumps core. Normally, it kills all peers of the dead backend
|
@@ -537,7 +530,6 @@ typedef struct
|
537 | 530 | #endif
|
538 | 531 | char my_exec_path[MAXPGPATH];
|
539 | 532 | char pkglib_path[MAXPGPATH];
|
540 |
| - char ExtraOptions[MAXPGPATH]; |
541 | 533 | } BackendParameters;
|
542 | 534 |
|
543 | 535 | static void read_backend_variables(char *id, Port *port);
|
@@ -694,7 +686,7 @@ PostmasterMain(int argc, char *argv[])
|
694 | 686 | * tcop/postgres.c (the option sets should not conflict) and with the
|
695 | 687 | * common help() function in main/main.c.
|
696 | 688 | */
|
697 |
| - while ((opt = getopt(argc, argv, "B:bc:C:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1) |
| 689 | + while ((opt = getopt(argc, argv, "B:bc:C:D:d:EeFf:h:ijk:lN:nOPp:r:S:sTt:W:-:")) != -1) |
698 | 690 | {
|
699 | 691 | switch (opt)
|
700 | 692 | {
|
@@ -773,13 +765,6 @@ PostmasterMain(int argc, char *argv[])
|
773 | 765 | SetConfigOption("allow_system_table_mods", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
774 | 766 | break;
|
775 | 767 |
|
776 |
| - case 'o': |
777 |
| - /* Other options to pass to the backend on the command line */ |
778 |
| - snprintf(ExtraOptions + strlen(ExtraOptions), |
779 |
| - sizeof(ExtraOptions) - strlen(ExtraOptions), |
780 |
| - " %s", optarg); |
781 |
| - break; |
782 |
| - |
783 | 768 | case 'P':
|
784 | 769 | SetConfigOption("ignore_system_indexes", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
785 | 770 | break;
|
@@ -4489,48 +4474,11 @@ BackendInitialize(Port *port)
|
4489 | 4474 | static void
|
4490 | 4475 | BackendRun(Port *port)
|
4491 | 4476 | {
|
4492 |
| - char **av; |
4493 |
| - int maxac; |
4494 |
| - int ac; |
4495 |
| - int i; |
| 4477 | + char *av[2]; |
| 4478 | + const int ac = 1; |
4496 | 4479 |
|
4497 |
| - /* |
4498 |
| - * Now, build the argv vector that will be given to PostgresMain. |
4499 |
| - * |
4500 |
| - * The maximum possible number of commandline arguments that could come |
4501 |
| - * from ExtraOptions is (strlen(ExtraOptions) + 1) / 2; see |
4502 |
| - * pg_split_opts(). |
4503 |
| - */ |
4504 |
| - maxac = 2; /* for fixed args supplied below */ |
4505 |
| - maxac += (strlen(ExtraOptions) + 1) / 2; |
4506 |
| - |
4507 |
| - av = (char **) MemoryContextAlloc(TopMemoryContext, |
4508 |
| - maxac * sizeof(char *)); |
4509 |
| - ac = 0; |
4510 |
| - |
4511 |
| - av[ac++] = "postgres"; |
4512 |
| - |
4513 |
| - /* |
4514 |
| - * Pass any backend switches specified with -o on the postmaster's own |
4515 |
| - * command line. We assume these are secure. |
4516 |
| - */ |
4517 |
| - pg_split_opts(av, &ac, ExtraOptions); |
4518 |
| - |
4519 |
| - av[ac] = NULL; |
4520 |
| - |
4521 |
| - Assert(ac < maxac); |
4522 |
| - |
4523 |
| - /* |
4524 |
| - * Debug: print arguments being passed to backend |
4525 |
| - */ |
4526 |
| - ereport(DEBUG3, |
4527 |
| - (errmsg_internal("%s child[%d]: starting with (", |
4528 |
| - progname, (int) getpid()))); |
4529 |
| - for (i = 0; i < ac; ++i) |
4530 |
| - ereport(DEBUG3, |
4531 |
| - (errmsg_internal("\t%s", av[i]))); |
4532 |
| - ereport(DEBUG3, |
4533 |
| - (errmsg_internal(")"))); |
| 4480 | + av[0] = "postgres"; |
| 4481 | + av[1] = NULL; |
4534 | 4482 |
|
4535 | 4483 | /*
|
4536 | 4484 | * Make sure we aren't in PostmasterContext anymore. (We can't delete it
|
@@ -6253,8 +6201,6 @@ save_backend_variables(BackendParameters *param, Port *port,
|
6253 | 6201 |
|
6254 | 6202 | strlcpy(param->pkglib_path, pkglib_path, MAXPGPATH);
|
6255 | 6203 |
|
6256 |
| - strlcpy(param->ExtraOptions, ExtraOptions, MAXPGPATH); |
6257 |
| - |
6258 | 6204 | return true;
|
6259 | 6205 | }
|
6260 | 6206 |
|
@@ -6485,8 +6431,6 @@ restore_backend_variables(BackendParameters *param, Port *port)
|
6485 | 6431 |
|
6486 | 6432 | strlcpy(pkglib_path, param->pkglib_path, MAXPGPATH);
|
6487 | 6433 |
|
6488 |
| - strlcpy(ExtraOptions, param->ExtraOptions, MAXPGPATH); |
6489 |
| - |
6490 | 6434 | /*
|
6491 | 6435 | * We need to restore fd.c's counts of externally-opened FDs; to avoid
|
6492 | 6436 | * confusion, be sure to do this after restoring max_safe_fds. (Note:
|
|
0 commit comments