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:
Tom Lane 2010-04-28 19:38:49 +00:00
parent 82e38abaf1
commit c80a85e3cd
2 changed files with 20 additions and 9 deletions

View File

@ -6,7 +6,7 @@
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001; * copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* licence: BSD * 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"), printf(_("Backup start location: %X/%X\n"),
ControlFile.backupStartPoint.xlogid, ControlFile.backupStartPoint.xlogid,
ControlFile.backupStartPoint.xrecoff); ControlFile.backupStartPoint.xrecoff);
printf(_("Last wal_level setting: %s\n"), printf(_("Current wal_level setting: %s\n"),
wal_level_str(ControlFile.wal_level)); wal_level_str(ControlFile.wal_level));
printf(_("Last max_connections setting: %d\n"), printf(_("Current max_connections setting: %d\n"),
ControlFile.MaxConnections); ControlFile.MaxConnections);
printf(_("Last max_prepared_xacts setting: %d\n"), printf(_("Current max_prepared_xacts setting: %d\n"),
ControlFile.max_prepared_xacts); 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); ControlFile.max_locks_per_xact);
printf(_("Maximum data alignment: %u\n"), printf(_("Maximum data alignment: %u\n"),
ControlFile.maxAlign); ControlFile.maxAlign);

View File

@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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.oldestXid = FirstNormalTransactionId;
ControlFile.checkPointCopy.oldestXidDB = InvalidOid; ControlFile.checkPointCopy.oldestXidDB = InvalidOid;
ControlFile.checkPointCopy.time = (pg_time_t) time(NULL); ControlFile.checkPointCopy.time = (pg_time_t) time(NULL);
ControlFile.checkPointCopy.oldestActiveXid = InvalidTransactionId;
ControlFile.state = DB_SHUTDOWNED; ControlFile.state = DB_SHUTDOWNED;
ControlFile.time = (pg_time_t) time(NULL); ControlFile.time = (pg_time_t) time(NULL);
ControlFile.checkPoint = ControlFile.checkPointCopy.redo; 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.maxAlign = MAXIMUM_ALIGNOF;
ControlFile.floatFormat = FLOATFORMAT_VALUE; ControlFile.floatFormat = FLOATFORMAT_VALUE;
ControlFile.blcksz = BLCKSZ; ControlFile.blcksz = BLCKSZ;
@ -574,6 +582,8 @@ PrintControlValues(bool guessed)
ControlFile.checkPointCopy.oldestXid); ControlFile.checkPointCopy.oldestXid);
printf(_("Latest checkpoint's oldestXID's DB: %u\n"), printf(_("Latest checkpoint's oldestXID's DB: %u\n"),
ControlFile.checkPointCopy.oldestXidDB); ControlFile.checkPointCopy.oldestXidDB);
printf(_("Latest checkpoint's oldestActiveXID: %u\n"),
ControlFile.checkPointCopy.oldestActiveXid);
printf(_("Maximum data alignment: %u\n"), printf(_("Maximum data alignment: %u\n"),
ControlFile.maxAlign); ControlFile.maxAlign);
/* we don't print floatFormat since can't say much useful about it */ /* we don't print floatFormat since can't say much useful about it */
@ -629,13 +639,14 @@ RewriteControlFile(void)
ControlFile.backupStartPoint.xrecoff = 0; ControlFile.backupStartPoint.xrecoff = 0;
/* /*
* Use the defaults for max_* settings. The values don't matter * Force the defaults for max_* settings. The values don't really matter
* as long as wal_level='minimal'. * 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.MaxConnections = 100;
ControlFile.max_prepared_xacts = 0; ControlFile.max_prepared_xacts = 0;
ControlFile.max_locks_per_xact = 64; 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. */ /* Now we can force the recorded xlog seg size to the right thing. */
ControlFile.xlog_seg_size = XLogSegSize; ControlFile.xlog_seg_size = XLogSegSize;