From: Tom Lane Date: Tue, 7 Mar 2006 17:32:22 +0000 (+0000) Subject: Turn off zero_damaged_pages in the right place (ie, in the autovac X-Git-Tag: REL8_2_BETA1~1261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6107da53c93dc188e257d72c3412510d2584093;p=postgresql Turn off zero_damaged_pages in the right place (ie, in the autovac process not in the postmaster) and with the right GucSource (needs to be a nontransactional source since we've not started an xact yet). --- diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 76295f47dd..d98f47f9b7 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.14 2006/03/07 03:03:09 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.15 2006/03/07 17:32:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -125,9 +125,6 @@ autovac_start(void) if (!AutoVacuumingActive()) return 0; - /* Even if zero_damaged_pages is true, we don't want autovacuum zeroing. */ - SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_SESSION); - /* * Do nothing if too soon since last autovacuum exit. This limits how * often the daemon runs. Since the time per iteration can be quite @@ -307,6 +304,13 @@ AutoVacMain(int argc, char *argv[]) PG_SETMASK(&UnBlockSig); + /* + * Force zero_damaged_pages OFF in the autovac process, even if it is + * set in postgresql.conf. We don't really want such a dangerous option + * being applied non-interactively. + */ + SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_OVERRIDE); + /* Get a list of databases */ dblist = autovac_get_database_list();