From 0892ecbc015930dde2cee9ad464b9b70fdb7667e Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 16 Sep 2013 14:36:01 +0300 Subject: [PATCH] Add a GUC to report whether data page checksums are enabled. Bernd Helmle --- doc/src/sgml/config.sgml | 13 +++++++++++++ src/backend/access/transam/xlog.c | 4 ++++ src/backend/utils/misc/guc.c | 12 ++++++++++++ 3 files changed, 29 insertions(+) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 18d75be1d7..370aa09ee7 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -6169,6 +6169,19 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' + + data_checksums (boolean) + + data_checksums configuration parameter + + + + Reports whether data checksums are enabled for this cluster. + See for more information. + + + + integer_datetimes (boolean) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index dc47c4760b..fc495d6a62 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4844,6 +4844,10 @@ ReadControlFile(void) " but the server was compiled without USE_FLOAT8_BYVAL."), errhint("It looks like you need to recompile or initdb."))); #endif + + /* Make the fixed settings visible as GUC variables, too */ + SetConfigOption("data_checksums", DataChecksumsEnabled() ? "yes" : "no", + PGC_INTERNAL, PGC_S_OVERRIDE); } void diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 7d297bcd34..3107f9cf02 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -466,6 +466,7 @@ static int max_identifier_length; static int block_size; static int segment_size; static int wal_block_size; +static bool data_checksums; static int wal_segment_size; static bool integer_datetimes; static int effective_io_concurrency; @@ -1457,6 +1458,17 @@ static struct config_bool ConfigureNamesBool[] = NULL, NULL, NULL }, + { + {"data_checksums", PGC_INTERNAL, PRESET_OPTIONS, + gettext_noop("Shows whether data checksums are turned on for this cluster"), + NULL, + GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE + }, + &data_checksums, + false, + NULL, NULL, NULL + }, + /* End-of-list marker */ { {NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL