*** pgsql/src/bin/scripts/vacuumdb.c 2009/01/01 17:23:55 1.22 --- pgsql/src/bin/scripts/vacuumdb.c 2009/02/18 12:11:55 1.23 *************** *** 5,11 **** * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * ! * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.21 2008/12/11 07:34:08 petere Exp $ * *------------------------------------------------------------------------- */ --- 5,11 ---- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * ! * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.22 2009/01/01 17:23:55 momjian Exp $ * *------------------------------------------------------------------------- */ *************** *** 15,25 **** static void vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, ! const char *table, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo); ! static void vacuum_all_databases(bool full, bool verbose, bool analyze, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo, bool quiet); --- 15,25 ---- static void vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, ! bool freeze, const char *table, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo); ! static void vacuum_all_databases(bool full, bool verbose, bool analyze, bool freeze, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo, bool quiet); *************** main(int argc, char *argv[]) *** 39,44 **** --- 39,45 ---- {"quiet", no_argument, NULL, 'q'}, {"dbname", required_argument, NULL, 'd'}, {"analyze", no_argument, NULL, 'z'}, + {"freeze", no_argument, NULL, 'F'}, {"all", no_argument, NULL, 'a'}, {"table", required_argument, NULL, 't'}, {"full", no_argument, NULL, 'f'}, *************** main(int argc, char *argv[]) *** 58,63 **** --- 59,65 ---- bool echo = false; bool quiet = false; bool analyze = false; + bool freeze = false; bool alldb = false; char *table = NULL; bool full = false; *************** main(int argc, char *argv[]) *** 68,74 **** handle_help_version_opts(argc, argv, "vacuumdb", help); ! while ((c = getopt_long(argc, argv, "h:p:U:Weqd:zat:fv", long_options, &optindex)) != -1) { switch (c) { --- 70,76 ---- handle_help_version_opts(argc, argv, "vacuumdb", help); ! while ((c = getopt_long(argc, argv, "h:p:U:Weqd:zaFt:fv", long_options, &optindex)) != -1) { switch (c) { *************** main(int argc, char *argv[]) *** 96,101 **** --- 98,106 ---- case 'z': analyze = true; break; + case 'F': + freeze = true; + break; case 'a': alldb = true; break; *************** main(int argc, char *argv[]) *** 145,151 **** exit(1); } ! vacuum_all_databases(full, verbose, analyze, host, port, username, password, progname, echo, quiet); } --- 150,156 ---- exit(1); } ! vacuum_all_databases(full, verbose, analyze, freeze, host, port, username, password, progname, echo, quiet); } *************** main(int argc, char *argv[]) *** 161,167 **** dbname = get_user_name(progname); } ! vacuum_one_database(dbname, full, verbose, analyze, table, host, port, username, password, progname, echo); } --- 166,172 ---- dbname = get_user_name(progname); } ! vacuum_one_database(dbname, full, verbose, analyze, freeze, table, host, port, username, password, progname, echo); } *************** main(int argc, char *argv[]) *** 172,178 **** static void vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, ! const char *table, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo) --- 177,183 ---- static void vacuum_one_database(const char *dbname, bool full, bool verbose, bool analyze, ! bool freeze, const char *table, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo) *************** vacuum_one_database(const char *dbname, *** 190,195 **** --- 195,202 ---- appendPQExpBuffer(&sql, " VERBOSE"); if (analyze) appendPQExpBuffer(&sql, " ANALYZE"); + if (freeze) + appendPQExpBuffer(&sql, " FREEZE"); if (table) appendPQExpBuffer(&sql, " %s", table); appendPQExpBuffer(&sql, ";\n"); *************** vacuum_one_database(const char *dbname, *** 212,218 **** static void ! vacuum_all_databases(bool full, bool verbose, bool analyze, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo, bool quiet) --- 219,225 ---- static void ! vacuum_all_databases(bool full, bool verbose, bool analyze, bool freeze, const char *host, const char *port, const char *username, bool password, const char *progname, bool echo, bool quiet) *************** vacuum_all_databases(bool full, bool ver *** 235,241 **** fflush(stdout); } ! vacuum_one_database(dbname, full, verbose, analyze, NULL, host, port, username, password, progname, echo); } --- 242,248 ---- fflush(stdout); } ! vacuum_one_database(dbname, full, verbose, analyze, freeze, NULL, host, port, username, password, progname, echo); } *************** help(const char *progname) *** 256,261 **** --- 263,269 ---- printf(_(" -t, --table='TABLE[(COLUMNS)]' vacuum specific table only\n")); printf(_(" -f, --full do full vacuuming\n")); printf(_(" -z, --analyze update optimizer hints\n")); + printf(_(" -F, --freeze freeze row transaction information\n")); printf(_(" -e, --echo show the commands being sent to the server\n")); printf(_(" -q, --quiet don't write any messages\n")); printf(_(" -v, --verbose write a lot of output\n"));