mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Remove -o option to postmaster
This option was declared obsolete many years ago. Reviewed-By: Tom Lane Discussion: https://postgr.es/m/CABUevEyOE=9CQwZm2j=vwP5+6OLCSoxn9pBjK8gyRdkTzMfqtQ@mail.gmail.com
This commit is contained in:
parent
6c57f2ed16
commit
d2e4bf688e
@ -280,32 +280,6 @@ PostgreSQL documentation
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>-o <replaceable class="parameter">extra-options</replaceable></option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The command-line-style arguments specified in <replaceable
|
|
||||||
class="parameter">extra-options</replaceable> are passed to
|
|
||||||
all server processes started by this
|
|
||||||
<command>postgres</command> process.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Spaces within <replaceable class="parameter">extra-options</replaceable> are
|
|
||||||
considered to separate arguments, unless escaped with a backslash
|
|
||||||
(<literal>\</literal>); write <literal>\\</literal> to represent a literal
|
|
||||||
backslash. Multiple arguments can also be specified via multiple
|
|
||||||
uses of <option>-o</option>.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
The use of this option is obsolete; all command-line options
|
|
||||||
for server processes can be specified directly on the
|
|
||||||
<command>postgres</command> command line.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-p <replaceable class="parameter">port</replaceable></option></term>
|
<term><option>-p <replaceable class="parameter">port</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -323,7 +323,6 @@ help(const char *progname)
|
|||||||
printf(_(" -l enable SSL connections\n"));
|
printf(_(" -l enable SSL connections\n"));
|
||||||
#endif
|
#endif
|
||||||
printf(_(" -N MAX-CONNECT maximum number of allowed connections\n"));
|
printf(_(" -N MAX-CONNECT maximum number of allowed connections\n"));
|
||||||
printf(_(" -o OPTIONS pass \"OPTIONS\" to each server process (obsolete)\n"));
|
|
||||||
printf(_(" -p PORT port number to listen on\n"));
|
printf(_(" -p PORT port number to listen on\n"));
|
||||||
printf(_(" -s show statistics after each query\n"));
|
printf(_(" -s show statistics after each query\n"));
|
||||||
printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n"));
|
printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n"));
|
||||||
|
@ -105,7 +105,6 @@
|
|||||||
#include "libpq/libpq.h"
|
#include "libpq/libpq.h"
|
||||||
#include "libpq/pqformat.h"
|
#include "libpq/pqformat.h"
|
||||||
#include "libpq/pqsignal.h"
|
#include "libpq/pqsignal.h"
|
||||||
#include "miscadmin.h"
|
|
||||||
#include "pg_getopt.h"
|
#include "pg_getopt.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "port/pg_bswap.h"
|
#include "port/pg_bswap.h"
|
||||||
@ -219,12 +218,6 @@ int ReservedBackends;
|
|||||||
/* The socket(s) we're listening to. */
|
/* The socket(s) we're listening to. */
|
||||||
#define MAXLISTEN 64
|
#define MAXLISTEN 64
|
||||||
static pgsocket ListenSocket[MAXLISTEN];
|
static pgsocket ListenSocket[MAXLISTEN];
|
||||||
|
|
||||||
/*
|
|
||||||
* Set by the -o option
|
|
||||||
*/
|
|
||||||
static char ExtraOptions[MAXPGPATH];
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These globals control the behavior of the postmaster in case some
|
* These globals control the behavior of the postmaster in case some
|
||||||
* backend dumps core. Normally, it kills all peers of the dead backend
|
* backend dumps core. Normally, it kills all peers of the dead backend
|
||||||
@ -537,7 +530,6 @@ typedef struct
|
|||||||
#endif
|
#endif
|
||||||
char my_exec_path[MAXPGPATH];
|
char my_exec_path[MAXPGPATH];
|
||||||
char pkglib_path[MAXPGPATH];
|
char pkglib_path[MAXPGPATH];
|
||||||
char ExtraOptions[MAXPGPATH];
|
|
||||||
} BackendParameters;
|
} BackendParameters;
|
||||||
|
|
||||||
static void read_backend_variables(char *id, Port *port);
|
static void read_backend_variables(char *id, Port *port);
|
||||||
@ -694,7 +686,7 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
* tcop/postgres.c (the option sets should not conflict) and with the
|
* tcop/postgres.c (the option sets should not conflict) and with the
|
||||||
* common help() function in main/main.c.
|
* common help() function in main/main.c.
|
||||||
*/
|
*/
|
||||||
while ((opt = getopt(argc, argv, "B:bc:C:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)
|
while ((opt = getopt(argc, argv, "B:bc:C:D:d:EeFf:h:ijk:lN:nOPp:r:S:sTt:W:-:")) != -1)
|
||||||
{
|
{
|
||||||
switch (opt)
|
switch (opt)
|
||||||
{
|
{
|
||||||
@ -773,13 +765,6 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
SetConfigOption("allow_system_table_mods", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
SetConfigOption("allow_system_table_mods", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'o':
|
|
||||||
/* Other options to pass to the backend on the command line */
|
|
||||||
snprintf(ExtraOptions + strlen(ExtraOptions),
|
|
||||||
sizeof(ExtraOptions) - strlen(ExtraOptions),
|
|
||||||
" %s", optarg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'P':
|
case 'P':
|
||||||
SetConfigOption("ignore_system_indexes", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
SetConfigOption("ignore_system_indexes", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
break;
|
break;
|
||||||
@ -4489,48 +4474,11 @@ BackendInitialize(Port *port)
|
|||||||
static void
|
static void
|
||||||
BackendRun(Port *port)
|
BackendRun(Port *port)
|
||||||
{
|
{
|
||||||
char **av;
|
char *av[2];
|
||||||
int maxac;
|
const int ac = 1;
|
||||||
int ac;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/*
|
av[0] = "postgres";
|
||||||
* Now, build the argv vector that will be given to PostgresMain.
|
av[1] = NULL;
|
||||||
*
|
|
||||||
* The maximum possible number of commandline arguments that could come
|
|
||||||
* from ExtraOptions is (strlen(ExtraOptions) + 1) / 2; see
|
|
||||||
* pg_split_opts().
|
|
||||||
*/
|
|
||||||
maxac = 2; /* for fixed args supplied below */
|
|
||||||
maxac += (strlen(ExtraOptions) + 1) / 2;
|
|
||||||
|
|
||||||
av = (char **) MemoryContextAlloc(TopMemoryContext,
|
|
||||||
maxac * sizeof(char *));
|
|
||||||
ac = 0;
|
|
||||||
|
|
||||||
av[ac++] = "postgres";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Pass any backend switches specified with -o on the postmaster's own
|
|
||||||
* command line. We assume these are secure.
|
|
||||||
*/
|
|
||||||
pg_split_opts(av, &ac, ExtraOptions);
|
|
||||||
|
|
||||||
av[ac] = NULL;
|
|
||||||
|
|
||||||
Assert(ac < maxac);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Debug: print arguments being passed to backend
|
|
||||||
*/
|
|
||||||
ereport(DEBUG3,
|
|
||||||
(errmsg_internal("%s child[%d]: starting with (",
|
|
||||||
progname, (int) getpid())));
|
|
||||||
for (i = 0; i < ac; ++i)
|
|
||||||
ereport(DEBUG3,
|
|
||||||
(errmsg_internal("\t%s", av[i])));
|
|
||||||
ereport(DEBUG3,
|
|
||||||
(errmsg_internal(")")));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure we aren't in PostmasterContext anymore. (We can't delete it
|
* Make sure we aren't in PostmasterContext anymore. (We can't delete it
|
||||||
@ -6253,8 +6201,6 @@ save_backend_variables(BackendParameters *param, Port *port,
|
|||||||
|
|
||||||
strlcpy(param->pkglib_path, pkglib_path, MAXPGPATH);
|
strlcpy(param->pkglib_path, pkglib_path, MAXPGPATH);
|
||||||
|
|
||||||
strlcpy(param->ExtraOptions, ExtraOptions, MAXPGPATH);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6485,8 +6431,6 @@ restore_backend_variables(BackendParameters *param, Port *port)
|
|||||||
|
|
||||||
strlcpy(pkglib_path, param->pkglib_path, MAXPGPATH);
|
strlcpy(pkglib_path, param->pkglib_path, MAXPGPATH);
|
||||||
|
|
||||||
strlcpy(ExtraOptions, param->ExtraOptions, MAXPGPATH);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to restore fd.c's counts of externally-opened FDs; to avoid
|
* We need to restore fd.c's counts of externally-opened FDs; to avoid
|
||||||
* confusion, be sure to do this after restoring max_safe_fds. (Note:
|
* confusion, be sure to do this after restoring max_safe_fds. (Note:
|
||||||
|
@ -3554,7 +3554,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx,
|
|||||||
* postmaster/postmaster.c (the option sets should not conflict) and with
|
* postmaster/postmaster.c (the option sets should not conflict) and with
|
||||||
* the common help() function in main/main.c.
|
* the common help() function in main/main.c.
|
||||||
*/
|
*/
|
||||||
while ((flag = getopt(argc, argv, "B:bc:C:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:v:W:-:")) != -1)
|
while ((flag = getopt(argc, argv, "B:bc:C:D:d:EeFf:h:ijk:lN:nOPp:r:S:sTt:v:W:-:")) != -1)
|
||||||
{
|
{
|
||||||
switch (flag)
|
switch (flag)
|
||||||
{
|
{
|
||||||
@ -3632,10 +3632,6 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx,
|
|||||||
SetConfigOption("allow_system_table_mods", "true", ctx, gucsource);
|
SetConfigOption("allow_system_table_mods", "true", ctx, gucsource);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'o':
|
|
||||||
errs++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'P':
|
case 'P':
|
||||||
SetConfigOption("ignore_system_indexes", "true", ctx, gucsource);
|
SetConfigOption("ignore_system_indexes", "true", ctx, gucsource);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user