Skip to content

Commit 0892ecb

Browse files
committed
Add a GUC to report whether data page checksums are enabled.
Bernd Helmle
1 parent cdeb79a commit 0892ecb

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

doc/src/sgml/config.sgml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6169,6 +6169,19 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
61696169
</listitem>
61706170
</varlistentry>
61716171

6172+
<varlistentry id="guc-data-checksums" xreflabel="data_checksums">
6173+
<term><varname>data_checksums</varname> (<type>boolean</type>)</term>
6174+
<indexterm>
6175+
<primary><varname>data_checksums</> configuration parameter</primary>
6176+
</indexterm>
6177+
<listitem>
6178+
<para>
6179+
Reports whether data checksums are enabled for this cluster.
6180+
See <xref linkend="app-initdb-data-checksums"> for more information.
6181+
</para>
6182+
</listitem>
6183+
</varlistentry>
6184+
61726185
<varlistentry id="guc-integer-datetimes" xreflabel="integer_datetimes">
61736186
<term><varname>integer_datetimes</varname> (<type>boolean</type>)</term>
61746187
<indexterm>

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4844,6 +4844,10 @@ ReadControlFile(void)
48444844
" but the server was compiled without USE_FLOAT8_BYVAL."),
48454845
errhint("It looks like you need to recompile or initdb.")));
48464846
#endif
4847+
4848+
/* Make the fixed settings visible as GUC variables, too */
4849+
SetConfigOption("data_checksums", DataChecksumsEnabled() ? "yes" : "no",
4850+
PGC_INTERNAL, PGC_S_OVERRIDE);
48474851
}
48484852

48494853
void

src/backend/utils/misc/guc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ static int max_identifier_length;
466466
static int block_size;
467467
static int segment_size;
468468
static int wal_block_size;
469+
static bool data_checksums;
469470
static int wal_segment_size;
470471
static bool integer_datetimes;
471472
static int effective_io_concurrency;
@@ -1457,6 +1458,17 @@ static struct config_bool ConfigureNamesBool[] =
14571458
NULL, NULL, NULL
14581459
},
14591460

1461+
{
1462+
{"data_checksums", PGC_INTERNAL, PRESET_OPTIONS,
1463+
gettext_noop("Shows whether data checksums are turned on for this cluster"),
1464+
NULL,
1465+
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
1466+
},
1467+
&data_checksums,
1468+
false,
1469+
NULL, NULL, NULL
1470+
},
1471+
14601472
/* End-of-list marker */
14611473
{
14621474
{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy