From: Bernd Helmle Date: Sat, 14 Sep 2013 16:24:42 +0000 (+0200) Subject: Add GUC data_checksums to report wether checksums for database blocks are enabled. X-Git-Url: http://git.postgresql.org/gitweb/sta%3Cscript%20data-cfasync=?a=commitdiff_plain;h=refs%2Fheads%2Fdata_checksum_guc;p=users%2Fbernd%2Fpostgres.git Add GUC data_checksums to report wether checksums for database blocks are enabled. --- diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 23ebc11202..5a1d9ac342 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -6169,6 +6169,20 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' + + data_checksums (boolean) + + data_checksums configuration parameter + + + + Reports wether data checksums are turned on or off for this + particular cluster. See for more + information. + + + + integer_datetimes (boolean) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 7d297bcd34..f2fccc47d2 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -199,6 +199,7 @@ static bool check_application_name(char **newval, void **extra, GucSource source static void assign_application_name(const char *newval, void *extra); static const char *show_unix_socket_permissions(void); static const char *show_log_file_mode(void); +static const char *show_data_checksums(void); static char *config_enum_get_options(struct config_enum * record, const char *prefix, const char *suffix, @@ -466,6 +467,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 +1459,18 @@ static struct config_bool ConfigureNamesBool[] = NULL, NULL, NULL }, + { + {"data_checksums", PGC_INTERNAL, PRESET_OPTIONS, + gettext_noop("Shows wether data checksums are turned on for this cluster"), + NULL, + GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE + }, + &data_checksums, + false, + NULL, NULL, show_data_checksums + }, + + /* End-of-list marker */ { {NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL @@ -8655,6 +8669,15 @@ assign_tcp_keepalives_idle(int newval, void *extra) (void) pq_setkeepalivesidle(newval, MyProcPort); } +static const char * +show_data_checksums(void) +{ + if (DataChecksumsEnabled()) + return "on"; + else + return "off"; +} + static const char * show_tcp_keepalives_idle(void) {