staticvoid
usage(constchar *progname)
{
printf(_("%s displays control information of a PostgreSQL database cluster.\n\n"), progname);
printf(_("Usage:\n"));
printf(_(" %s [OPTION] [DATADIR]\n"), progname);
printf(_("\nOptions:\n"));
printf(_(" [-D, --pgdata=]DATADIR data directory\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -?, --help show this help, then exit\n"));
printf(_("\nIf no data directory (DATADIR) is specified, " "the environment variable PGDATA\nis used.\n\n"));
printf(_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
}
staticconstchar *
dbState(DBState state)
{ switch (state)
{ case DB_STARTUP: return _("starting up"); case DB_SHUTDOWNED: return _("shut down"); case DB_SHUTDOWNED_IN_RECOVERY: return _("shut down in recovery"); case DB_SHUTDOWNING: return _("shutting down"); case DB_IN_CRASH_RECOVERY: return _("in crash recovery"); case DB_IN_ARCHIVE_RECOVERY: return _("in archive recovery"); case DB_IN_PRODUCTION: return _("in production");
} return _("unrecognized status code");
}
staticconstchar *
wal_level_str(WalLevel wal_level)
{ switch (wal_level)
{ case WAL_LEVEL_MINIMAL: return"minimal"; case WAL_LEVEL_REPLICA: return"replica"; case WAL_LEVEL_LOGICAL: return"logical";
} return _("unrecognized \"wal_level\"");
}
default: /* getopt_long already emitted a complaint */
pg_log_error_hint("Try \"%s --help\" for more information.", progname); exit(1);
}
}
if (DataDir == NULL)
{ if (optind < argc)
DataDir = argv[optind++]; else
DataDir = getenv("PGDATA");
}
/* Complain if any arguments remain */ if (optind < argc)
{
pg_log_error("too many command-line arguments (first is \"%s\")",
argv[optind]);
pg_log_error_hint("Try \"%s --help\" for more information.", progname); exit(1);
}
if (DataDir == NULL)
{
pg_log_error("no data directory specified");
pg_log_error_hint("Try \"%s --help\" for more information.", progname); exit(1);
}
/* get a copy of the control file */
ControlFile = get_controlfile(DataDir, &crc_ok); if (!crc_ok)
{
pg_log_warning("calculated CRC checksum does not match value stored in control file");
pg_log_warning_detail("Either the control file is corrupt, or it has a different layout than this program " "is expecting. The results below are untrustworthy.");
}
/* set wal segment size */
WalSegSz = ControlFile->xlog_seg_size;
if (!IsValidWalSegSize(WalSegSz))
{
pg_log_warning(ngettext("invalid WAL segment size in control file (%d byte)", "invalid WAL segment size in control file (%d bytes)",
WalSegSz),
WalSegSz);
pg_log_warning_detail("The WAL segment size must be a power of two between 1 MB and 1 GB.");
pg_log_warning_detail("The file is corrupt and the results below are untrustworthy.");
}
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.