From: Heikki Linnakangas Date: Mon, 16 Sep 2013 11:36:01 +0000 (+0300) Subject: Add a GUC to report whether data page checksums are enabled. X-Git-Tag: REL9_3_4~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a7e75849cb595943fc605c4532716e9dd69f8a0;p=postgresql Add a GUC to report whether data page checksums are enabled. Backported from master. It was an oversight in the original data checksums patch to not have a GUC like this. --- diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index c7d708bd16..108296e14c 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -6171,6 +6171,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 314b9e97fa..d57bf50e0b 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -3739,6 +3739,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 initdb 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 68af19221e..eae0d97bdc 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -464,6 +464,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; @@ -1453,6 +1454,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