Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5a7e758

Browse files
committed
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.
1 parent 0aaa422 commit 5a7e758

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
@@ -6171,6 +6171,19 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
61716171
</listitem>
61726172
</varlistentry>
61736173

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

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3739,6 +3739,10 @@ ReadControlFile(void)
37393739
" but the server was compiled without USE_FLOAT8_BYVAL."),
37403740
errhint("It looks like you need to recompile or initdb.")));
37413741
#endif
3742+
3743+
/* Make the initdb settings visible as GUC variables, too */
3744+
SetConfigOption("data_checksums", DataChecksumsEnabled() ? "yes" : "no",
3745+
PGC_INTERNAL, PGC_S_OVERRIDE);
37423746
}
37433747

37443748
void

src/backend/utils/misc/guc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ static int max_identifier_length;
464464
static int block_size;
465465
static int segment_size;
466466
static int wal_block_size;
467+
static bool data_checksums;
467468
static int wal_segment_size;
468469
static bool integer_datetimes;
469470
static int effective_io_concurrency;
@@ -1453,6 +1454,17 @@ static struct config_bool ConfigureNamesBool[] =
14531454
NULL, NULL, NULL
14541455
},
14551456

1457+
{
1458+
{"data_checksums", PGC_INTERNAL, PRESET_OPTIONS,
1459+
gettext_noop("Shows whether data checksums are turned on for this cluster"),
1460+
NULL,
1461+
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
1462+
},
1463+
&data_checksums,
1464+
false,
1465+
NULL, NULL, NULL
1466+
},
1467+
14561468
/* End-of-list marker */
14571469
{
14581470
{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL

0 commit comments

Comments
 (0)