aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/vacuumdb.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-08 04:33:55 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-08 04:33:55 +0000
commit0a469c87692d15a22eaa69d4b3a43dd8e278dd64 (patch)
tree34353dece3a2a8da2c599562685831bdcb14080e /src/bin/scripts/vacuumdb.c
parent1ddc2703a936d03953657f43345460b9242bbed1 (diff)
downloadpostgresql-0a469c87692d15a22eaa69d4b3a43dd8e278dd64.tar.gz
postgresql-0a469c87692d15a22eaa69d4b3a43dd8e278dd64.zip
Remove old-style VACUUM FULL (which was known for a little while as
VACUUM FULL INPLACE), along with a boatload of subsidiary code and complexity. Per discussion, the use case for this method of vacuuming is no longer large enough to justify maintaining it; not to mention that we don't wish to invest the work that would be needed to make it play nicely with Hot Standby. Aside from the code directly related to old-style VACUUM FULL, this commit removes support for certain WAL record types that could only be generated within VACUUM FULL, redirect-pointer removal in heap_page_prune, and nontransactional generation of cache invalidation sinval messages (the last being the sticking point for Hot Standby). We still have to retain all code that copes with finding HEAP_MOVED_OFF and HEAP_MOVED_IN flag bits on existing tuples. This can't be removed as long as we want to support in-place update from pre-9.0 databases.
Diffstat (limited to 'src/bin/scripts/vacuumdb.c')
-rw-r--r--src/bin/scripts/vacuumdb.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index a70d26429bd..242ea9ebae1 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.33 2010/01/07 14:35:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.34 2010/02/08 04:33:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -14,12 +14,12 @@
#include "common.h"
-static void vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose,
+static void vacuum_one_database(const char *dbname, bool full, bool verbose,
bool and_analyze, bool analyze_only, bool freeze,
const char *table, const char *host, const char *port,
const char *username, enum trivalue prompt_password,
const char *progname, bool echo);
-static void vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze,
+static void vacuum_all_databases(bool full, bool verbose, bool and_analyze,
bool analyze_only, bool freeze,
const char *host, const char *port,
const char *username, enum trivalue prompt_password,
@@ -47,7 +47,6 @@ main(int argc, char *argv[])
{"table", required_argument, NULL, 't'},
{"full", no_argument, NULL, 'f'},
{"verbose", no_argument, NULL, 'v'},
- {"inplace", no_argument, NULL, 'i'},
{NULL, 0, NULL, 0}
};
@@ -69,14 +68,13 @@ main(int argc, char *argv[])
char *table = NULL;
bool full = false;
bool verbose = false;
- bool inplace = false;
progname = get_progname(argv[0]);
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
handle_help_version_opts(argc, argv, "vacuumdb", help);
- while ((c = getopt_long(argc, argv, "h:p:U:wWeqd:zaFt:fiv", long_options, &optindex)) != -1)
+ while ((c = getopt_long(argc, argv, "h:p:U:wWeqd:zaFt:fv", long_options, &optindex)) != -1)
{
switch (c)
{
@@ -122,9 +120,6 @@ main(int argc, char *argv[])
case 'f':
full = true;
break;
- case 'i':
- inplace = true;
- break;
case 'v':
verbose = true;
break;
@@ -148,13 +143,6 @@ main(int argc, char *argv[])
exit(1);
}
- if (inplace && !full)
- {
- fprintf(stderr, _("%s: cannot use the \"inplace\" option when performing full vacuum\n"),
- progname);
- exit(1);
- }
-
if (analyze_only)
{
if (full)
@@ -189,7 +177,7 @@ main(int argc, char *argv[])
exit(1);
}
- vacuum_all_databases(full, inplace, verbose, and_analyze, analyze_only, freeze,
+ vacuum_all_databases(full, verbose, and_analyze, analyze_only, freeze,
host, port, username, prompt_password,
progname, echo, quiet);
}
@@ -205,7 +193,7 @@ main(int argc, char *argv[])
dbname = get_user_name(progname);
}
- vacuum_one_database(dbname, full, inplace, verbose, and_analyze, analyze_only,
+ vacuum_one_database(dbname, full, verbose, and_analyze, analyze_only,
freeze, table,
host, port, username, prompt_password,
progname, echo);
@@ -216,7 +204,7 @@ main(int argc, char *argv[])
static void
-vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose, bool and_analyze,
+vacuum_one_database(const char *dbname, bool full, bool verbose, bool and_analyze,
bool analyze_only, bool freeze, const char *table,
const char *host, const char *port,
const char *username, enum trivalue prompt_password,
@@ -247,8 +235,7 @@ vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose, b
if (full)
{
- appendPQExpBuffer(&sql, "%sFULL%s", sep,
- inplace ? " INPLACE" : "");
+ appendPQExpBuffer(&sql, "%sFULL", sep);
sep = comma;
}
if (freeze)
@@ -271,10 +258,6 @@ vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose, b
}
else
{
- /*
- * On older servers, VACUUM FULL is equivalent to VACUUM (FULL
- * INPLACE) on newer servers, so we can ignore 'inplace'.
- */
if (full)
appendPQExpBuffer(&sql, " FULL");
if (freeze)
@@ -306,7 +289,7 @@ vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose, b
static void
-vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze, bool analyze_only,
+vacuum_all_databases(bool full, bool verbose, bool and_analyze, bool analyze_only,
bool freeze, const char *host, const char *port,
const char *username, enum trivalue prompt_password,
const char *progname, bool echo, bool quiet)
@@ -329,7 +312,7 @@ vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze, bo
fflush(stdout);
}
- vacuum_one_database(dbname, full, inplace, verbose, and_analyze, analyze_only,
+ vacuum_one_database(dbname, full, verbose, and_analyze, analyze_only,
freeze, NULL, host, port, username, prompt_password,
progname, echo);
}
@@ -350,7 +333,6 @@ help(const char *progname)
printf(_(" -e, --echo show the commands being sent to the server\n"));
printf(_(" -f, --full do full vacuuming\n"));
printf(_(" -F, --freeze freeze row transaction information\n"));
- printf(_(" -i, --inplace do full inplace vacuuming\n"));
printf(_(" -q, --quiet don't write any messages\n"));
printf(_(" -t, --table='TABLE[(COLUMNS)]' vacuum specific table only\n"));
printf(_(" -v, --verbose write a lot of output\n"));