/* We keep these set to "C" always. See pg_locale.c for explanation. */
init_locale("LC_MONETARY", LC_MONETARY, "C");
init_locale("LC_NUMERIC", LC_NUMERIC, "C");
init_locale("LC_TIME", LC_TIME, "C");
/* *Maketheinitialpermanentsettingforalocalecategory.Ifthatfails, *perhapsduetoLC_foo=invalidintheenvironment,uselocaleC.Ifeven *thatfails,perhapsduetoout-of-memory,theentirestartupfailswithit. *Whenthisreturns,weareguaranteedtohaveasettingforthegiven *category'senvironmentvariable.
*/ staticvoid
init_locale(constchar *categoryname, int category, constchar *locale)
{ if (pg_perm_setlocale(category, locale) == NULL &&
pg_perm_setlocale(category, "C") == NULL)
elog(FATAL, "could not adopt \"%s\" locale nor C locale for %s",
locale, categoryname);
}
/* *HelpdisplayshouldmatchtheoptionsacceptedbyPostmasterMain() *andPostgresMain(). * *XXXOnWindows,non-ASCIIlocalizationsofthesemessagesonlydisplay *correctlyiftheconsoleoutputcodepagecoversthenecessarycharacters. *Messagesemittedinwrite_console()donotexhibitthisproblem.
*/ staticvoid
help(constchar *progname)
{
printf(_("%s is the PostgreSQL server.\n\n"), progname);
printf(_("Usage:\n %s [OPTION]...\n\n"), progname);
printf(_("Options:\n"));
printf(_(" -B NBUFFERS number of shared buffers\n"));
printf(_(" -c NAME=VALUE set run-time parameter\n"));
printf(_(" -C NAME print value of run-time parameter, then exit\n"));
printf(_(" -d 1-5 debugging level\n"));
printf(_(" -D DATADIR database directory\n"));
printf(_(" -e use European date input format (DMY)\n"));
printf(_(" -F turn fsync off\n"));
printf(_(" -h HOSTNAME host name or IP address to listen on\n"));
printf(_(" -i enable TCP/IP connections (deprecated)\n"));
printf(_(" -k DIRECTORY Unix-domain socket location\n")); #ifdef USE_SSL
printf(_(" -l enable SSL connections\n")); #endif
printf(_(" -N MAX-CONNECT maximum number of allowed connections\n"));
printf(_(" -p PORT port number to listen on\n"));
printf(_(" -s show statistics after each query\n"));
printf(_(" -S WORK-MEM set amount of memory for sorts (in kB)\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" --NAME=VALUE set run-time parameter\n"));
printf(_(" --describe-config describe configuration parameters, then exit\n"));
printf(_(" -?, --help show this help, then exit\n"));
printf(_("\nDeveloper options:\n"));
printf(_(" -f s|i|o|b|t|n|m|h forbid use of some plan types\n"));
printf(_(" -O allow system table structure changes\n"));
printf(_(" -P disable system indexes\n"));
printf(_(" -t pa|pl|ex show timings after each query\n"));
printf(_(" -T send SIGABRT to all backend processes if one dies\n"));
printf(_(" -W NUM wait NUM seconds to allow attach from a debugger\n"));
printf(_("\nOptions for single-user mode:\n"));
printf(_(" --single selects single-user mode (must be first argument)\n"));
printf(_(" DBNAME database name (defaults to user name)\n"));
printf(_(" -d 0-5 override debugging level\n"));
printf(_(" -E echo statement before execution\n"));
printf(_(" -j do not use newline as interactive query delimiter\n"));
printf(_(" -r FILENAME send stdout and stderr to given file\n"));
printf(_("\nOptions for bootstrapping mode:\n"));
printf(_(" --boot selects bootstrapping mode (must be first argument)\n"));
printf(_(" --check selects check mode (must be first argument)\n"));
printf(_(" DBNAME database name (mandatory argument in bootstrapping mode)\n"));
printf(_(" -r FILENAME send stdout and stderr to given file\n"));
printf(_("\nPlease read the documentation for the complete list of run-time\n" "configuration settings and how to set them on the command line or in\n" "the configuration file.\n\n" "Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
}
staticvoid
check_root(constchar *progname)
{ #ifndef WIN32 if (geteuid() == 0)
{
write_stderr("\"root\" execution of the PostgreSQL server is not permitted.\n" "The server must be started under an unprivileged user ID to prevent\n" "possible system security compromise. See the documentation for\n" "more information on how to properly start the server.\n"); exit(1);
}
/* *Alsomakesurethatrealandeffectiveuidsarethesame.Executingas *asetuidprogramfromarootshellisasecurityhole,sinceonmany *platformsanefarioussubroutinecouldsetuidbacktorootifrealuid *isroot.(Sincenobodyactuallyusespostgresasasetuidprogram, *tryingtoactivelyfixthissituationseemsmoretroublethanit's *worth;we'lljustexpendtheefforttocheckforit.)
*/ if (getuid() != geteuid())
{
write_stderr("%s: real and effective user IDs must match\n",
progname); exit(1);
} #else/* WIN32 */ if (pgwin32_is_admin())
{
write_stderr("Execution of PostgreSQL by a user with administrative permissions is not\n" "permitted.\n" "The server must be started under an unprivileged user ID to prevent\n" "possible system security compromises. See the documentation for\n" "more information on how to properly start the server.\n"); exit(1);
} #endif/* WIN32 */
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.