mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Minor editorializing on pg_controldata and pg_resetxlog: adjust some message
wording, deal explicitly with some fields that were being silently left zero.
This commit is contained in:
parent
82e38abaf1
commit
c80a85e3cd
@ -6,7 +6,7 @@
|
||||
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
|
||||
* licence: BSD
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.48 2010/04/28 17:35:35 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.49 2010/04/28 19:38:49 tgl Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -230,13 +230,13 @@ main(int argc, char *argv[])
|
||||
printf(_("Backup start location: %X/%X\n"),
|
||||
ControlFile.backupStartPoint.xlogid,
|
||||
ControlFile.backupStartPoint.xrecoff);
|
||||
printf(_("Last wal_level setting: %s\n"),
|
||||
printf(_("Current wal_level setting: %s\n"),
|
||||
wal_level_str(ControlFile.wal_level));
|
||||
printf(_("Last max_connections setting: %d\n"),
|
||||
printf(_("Current max_connections setting: %d\n"),
|
||||
ControlFile.MaxConnections);
|
||||
printf(_("Last max_prepared_xacts setting: %d\n"),
|
||||
printf(_("Current max_prepared_xacts setting: %d\n"),
|
||||
ControlFile.max_prepared_xacts);
|
||||
printf(_("Last max_locks_per_xact setting: %d\n"),
|
||||
printf(_("Current max_locks_per_xact setting: %d\n"),
|
||||
ControlFile.max_locks_per_xact);
|
||||
printf(_("Maximum data alignment: %u\n"),
|
||||
ControlFile.maxAlign);
|
||||
|
@ -23,7 +23,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.79 2010/04/28 16:10:43 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.80 2010/04/28 19:38:49 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -497,11 +497,19 @@ GuessControlValues(void)
|
||||
ControlFile.checkPointCopy.oldestXid = FirstNormalTransactionId;
|
||||
ControlFile.checkPointCopy.oldestXidDB = InvalidOid;
|
||||
ControlFile.checkPointCopy.time = (pg_time_t) time(NULL);
|
||||
ControlFile.checkPointCopy.oldestActiveXid = InvalidTransactionId;
|
||||
|
||||
ControlFile.state = DB_SHUTDOWNED;
|
||||
ControlFile.time = (pg_time_t) time(NULL);
|
||||
ControlFile.checkPoint = ControlFile.checkPointCopy.redo;
|
||||
|
||||
/* minRecoveryPoint and backupStartPoint can be left zero */
|
||||
|
||||
ControlFile.wal_level = WAL_LEVEL_MINIMAL;
|
||||
ControlFile.MaxConnections = 100;
|
||||
ControlFile.max_prepared_xacts = 0;
|
||||
ControlFile.max_locks_per_xact = 64;
|
||||
|
||||
ControlFile.maxAlign = MAXIMUM_ALIGNOF;
|
||||
ControlFile.floatFormat = FLOATFORMAT_VALUE;
|
||||
ControlFile.blcksz = BLCKSZ;
|
||||
@ -574,6 +582,8 @@ PrintControlValues(bool guessed)
|
||||
ControlFile.checkPointCopy.oldestXid);
|
||||
printf(_("Latest checkpoint's oldestXID's DB: %u\n"),
|
||||
ControlFile.checkPointCopy.oldestXidDB);
|
||||
printf(_("Latest checkpoint's oldestActiveXID: %u\n"),
|
||||
ControlFile.checkPointCopy.oldestActiveXid);
|
||||
printf(_("Maximum data alignment: %u\n"),
|
||||
ControlFile.maxAlign);
|
||||
/* we don't print floatFormat since can't say much useful about it */
|
||||
@ -629,13 +639,14 @@ RewriteControlFile(void)
|
||||
ControlFile.backupStartPoint.xrecoff = 0;
|
||||
|
||||
/*
|
||||
* Use the defaults for max_* settings. The values don't matter
|
||||
* as long as wal_level='minimal'.
|
||||
* Force the defaults for max_* settings. The values don't really matter
|
||||
* as long as wal_level='minimal'; the postmaster will reset these fields
|
||||
* anyway at startup.
|
||||
*/
|
||||
ControlFile.wal_level = WAL_LEVEL_MINIMAL;
|
||||
ControlFile.MaxConnections = 100;
|
||||
ControlFile.max_prepared_xacts = 0;
|
||||
ControlFile.max_locks_per_xact = 64;
|
||||
ControlFile.wal_level = WAL_LEVEL_MINIMAL;
|
||||
|
||||
/* Now we can force the recorded xlog seg size to the right thing. */
|
||||
ControlFile.xlog_seg_size = XLogSegSize;
|
||||
|
Loading…
Reference in New Issue
Block a user