summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc
diff options
context:
space:
mode:
authorTom Lane2003-03-28 20:17:13 +0000
committerTom Lane2003-03-28 20:17:13 +0000
commitfd42262836be6c3fdf77cc0c774964f04acdc913 (patch)
treef45034cde07c773e6cf56621ba0f8b7933c40bfb /src/backend/utils/misc
parentbb3c00ee28721258d5d74c7827663a828b9387ae (diff)
Add code to apply some simple sanity checks to the header fields of a
page when it's read in, per pghackers discussion around 17-Feb. Add a GUC variable zero_damaged_pages that causes the response to be a WARNING followed by zeroing the page, rather than the normal ERROR; this is per Hiroshi's suggestion that there needs to be a way to get at the data in the rest of the table.
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r--src/backend/utils/misc/guc.c6
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 7c5d6d18849..89b62527797 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -5,7 +5,7 @@
* command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.117 2003/03/20 04:51:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.118 2003/03/28 20:17:13 tgl Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <[email protected]>.
@@ -358,6 +358,10 @@ static struct config_bool
true, NULL, NULL
},
{
+ {"zero_damaged_pages", PGC_SUSET}, &zero_damaged_pages,
+ false, NULL, NULL
+ },
+ {
{"silent_mode", PGC_POSTMASTER}, &SilentMode,
false, NULL, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index d14e9c78db8..ebf99187c67 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -213,6 +213,6 @@
#sql_inheritance = true
#transform_null_equals = false
#statement_timeout = 0 # 0 is disabled, in milliseconds
+#zero_damaged_pages = false # set this true only for disaster recovery
#db_user_namespace = false
#preload_libraries = ''
-