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>
Mon, 16 Sep 2013 11:36:01 +0000 (14:36 +0300)
Bernd Helmle

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

index 18d75be1d7904796ef7f4f539b42aa607796bd8e..370aa09ee7c3f750f7ea5a76f18fc54b86f8e984 100644 (file)
@@ -6169,6 +6169,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 dc47c4760bf253e8855ad7b21ae2864f2a502367..fc495d6a62df9782b990093d02fb2ffd190f0daa 100644 (file)
@@ -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
index 7d297bcd343fb60824fa43ef7022792923904bcd..3107f9cf0274177a88d5974128f7c64e18d334ad 100644 (file)
@@ -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