diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 1f9a940aa0..0413fc11cc 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ @@ -671,6 +671,19 @@ env PGOPTIONS='--geqo=off' psql + + DEBUG_ASSERTIONS (boolean) + + + Turns on various assertion checks. This is a debugging aid. If + you are experiencing strange problems or crashes you might + want to turn this on, as it might expose programming mistakes. + To use this option, the macro USE_ASSERT_CHECKING + must be defined when Postgres is built. + + + + DEBUG_LEVEL (integer) @@ -843,13 +856,13 @@ env PGOPTIONS='--geqo=off' psql - MAX_BACKENDS (integer) + MAX_CONNECTIONS (integer) Determines how many concurrent connections the database server - will allow. The default is 32. Note that there is also a - compiled-in hard limit on this option, which is currently - 1024. This parameter can only be set at server start. + will allow. The default is 32. There is also a compiled-in + hard upper limit on this option, which is currently 1024. This + parameter can only be set at server start. @@ -868,7 +881,7 @@ env PGOPTIONS='--geqo=off' psql - NET_SERVER (boolean) + TCPIP_SOCKET (boolean) If this is true, then the server will accept TCP/IP @@ -922,12 +935,12 @@ env PGOPTIONS='--geqo=off' psql This controls the inheritance semantics, in particular whether subtables are included into the consideration of various commands by default. This was not the case in versions prior - to 7.1. If you need this behaviour you can set this variable - to off, but in the long run you are encouraged to change your - applications to use the ONLY keyword to - exclude subtables. See the SQL language reference and the - User's Guide for more information about - inheritance. + to 7.1. If you need the old behaviour you can set this + variable to off, but in the long run you are encouraged to + change your applications to use the ONLY + keyword to exclude subtables. See the SQL language reference + and the User's Guide for more + information about inheritance. @@ -971,12 +984,12 @@ env PGOPTIONS='--geqo=off' psql -i - net_server = on + tcpip_socket = on -N x - max_backends = x + max_connections = x diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 580786c2e6..fe6b7b1455 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.154 2000/07/09 13:14:05 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.155 2000/07/12 17:38:42 petere Exp $ * * NOTES * @@ -280,11 +280,6 @@ void GetCharSetByHost(char *, int, char *); #endif -#ifdef USE_ASSERT_CHECKING - -int assert_enabled = 1; - -#endif static void checkDataDir(const char *DataDir) @@ -387,13 +382,46 @@ PostmasterMain(int argc, char *argv[]) * will occur. */ opterr = 1; - while ((opt = getopt(argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:")) != EOF) + while ((opt = getopt(argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:?")) != EOF) { - if (opt == 'D') + switch(opt) { - if (DataDir) - free(DataDir); - DataDir = strdup(optarg); + case 'D': + if (DataDir) + free(DataDir); + DataDir = strdup(optarg); + break; + + case '-': + { + char *name, *value; + + ParseLongOption(optarg, &name, &value); + if (strcmp(name, "help")==0) + { + usage(progname); + exit(0); + } + else if (strcmp(name, "version")==0) + { + puts("postmaster (PostgreSQL) " PG_VERSION); + exit(0); + } + break; + } + + case '?': + if (strcmp(argv[optind - 1], "-?") == 0) + { + usage(progname); + exit(0); + } + else + { + fprintf(stderr, "Try -? for help.\n"); + exit(1); + } + break; } } @@ -403,21 +431,15 @@ PostmasterMain(int argc, char *argv[]) ProcessConfigFile(PGC_POSTMASTER); IgnoreSystemIndexes(false); - while ((opt = getopt(argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:")) != EOF) + while ((opt = getopt(argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:?")) != EOF) { switch (opt) { case 'A': #ifndef USE_ASSERT_CHECKING - fprintf(stderr, "Assert checking is not enabled\n"); + fprintf(stderr, "Assert checking is not compiled in\n"); #else - - /* - * Pass this option also to each backend. - */ assert_enabled = atoi(optarg); - strcat(ExtraOptions, " -A "); - strcat(ExtraOptions, optarg); #endif break; case 'a': @@ -525,13 +547,23 @@ PostmasterMain(int argc, char *argv[]) free(value); break; } + default: - /* usage() never returns */ - usage(progname); - break; + /* shouldn't get here */ + fprintf(stderr, "Try -? for help.\n"); + exit(1); } } + /* + * Non-option switch arguments don't exist. + */ + if (optind < argc) + { + fprintf(stderr, "%s: invalid argument -- %s\n", progname, argv[optind]); + exit(1); + } + /* * Check for invalid combinations of switches */ @@ -543,7 +575,7 @@ PostmasterMain(int argc, char *argv[]) * for lack of buffers. The specific choices here are somewhat * arbitrary. */ - fprintf(stderr, "%s: -B must be at least twice -N and at least 16.\n", + fprintf(stderr, "%s: The number of buffers (-B) must be at least twice the number of allowed connections (-N) and at least 16.\n", progname); exit(1); } @@ -717,30 +749,43 @@ pmdaemonize(int argc, char *argv[]) on_proc_exit(UnlinkPidFile, NULL); } + + +/* + * Print out help message + */ static void usage(const char *progname) { - fprintf(stderr, "usage: %s [options]\n", progname); + printf("%s is the PostgreSQL server.\n\n", progname); + printf("Usage:\n %s [options]\n\n", progname); + printf("Options:\n"); #ifdef USE_ASSERT_CHECKING - fprintf(stderr, "\t-A [1|0]\tenable/disable runtime assert checking\n"); + printf(" -A 1|0 enable/disable runtime assert checking\n"); #endif - fprintf(stderr, "\t-B nbufs\tset number of shared buffers\n"); - fprintf(stderr, "\t-D datadir\tset data directory\n"); - fprintf(stderr, "\t-S \t\tsilent mode (disassociate from tty)\n"); - fprintf(stderr, "\t-a system\tuse this authentication system\n"); - fprintf(stderr, "\t-b backend\tuse a specific backend server executable\n"); - fprintf(stderr, "\t-d [1-5]\tset debugging level\n"); - fprintf(stderr, "\t-i \t\tlisten on TCP/IP sockets as well as Unix domain socket\n"); + printf(" -B number of shared buffers\n"); + printf(" -d 1-5 debugging level\n"); + printf(" -D database directory\n"); + printf(" -F turn fsync off\n"); + printf(" -i listen on TCP/IP sockets\n"); #ifdef USE_SSL - fprintf(stderr, " \t-l \t\tfor TCP/IP sockets, listen only on SSL connections\n"); + printf(" -l listen only on SSL connections (EXPERIMENTAL)\n"); #endif - fprintf(stderr, "\t-N nprocs\tset max number of backends (1..%d, default %d)\n", + printf(" -N maximum number of allowed connections (1..%d, default %d)\n", MAXBACKENDS, DEF_MAXBACKENDS); - fprintf(stderr, "\t-n \t\tdon't reinitialize shared memory after abnormal exit\n"); - fprintf(stderr, "\t-o option\tpass 'option' to each backend servers\n"); - fprintf(stderr, "\t-p port\tspecify port for postmaster to listen on\n"); - fprintf(stderr, "\t-s \t\tsend SIGSTOP to all backend servers if one dies\n"); - exit(1); + printf(" -o