]> granicus.if.org Git - postgresql/commitdiff
Add a GUC to report whether data page checksums are enabled.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 16 Sep 2013 11:36:01 +0000 (14:36 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 20 Feb 2014 08:46:54 +0000 (10:46 +0200)
Backported from master. It was an oversight in the original data checksums
patch to not have a GUC like this.

doc/src/sgml/config.sgml
src/backend/access/transam/xlog.c
src/backend/utils/misc/guc.c

index c7d708bd16d8ed5818464d7aee2c339ed30b3057..108296e14c473aa1d697406bbbaf783ecb727805 100644 (file)
@@ -6171,6 +6171,19 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
       </listitem>
      </varlistentry>
 
+     <varlistentry id="guc-data-checksums" xreflabel="data_checksums">
+      <term><varname>data_checksums</varname> (<type>boolean</type>)</term>
+      <indexterm>
+       <primary><varname>data_checksums</> configuration parameter</primary>
+      </indexterm>
+      <listitem>
+       <para>
+        Reports whether data checksums are enabled for this cluster.
+        See <xref linkend="app-initdb-data-checksums"> for more information.
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry id="guc-integer-datetimes" xreflabel="integer_datetimes">
       <term><varname>integer_datetimes</varname> (<type>boolean</type>)</term>
       <indexterm>
index 314b9e97fae86de9ea331636c4dcadf222641fe1..d57bf50e0b448163b5bd7223920d50148c185a37 100644 (file)
@@ -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
index 68af19221e0cec117f6c999bfb36b8c965ef52e3..eae0d97bdc3c61ec92713bfa9f3de325d856a266 100644 (file)
@@ -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