*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.13 1997/01/10 09:57:16 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.14 1997/01/13 03:43:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif /* NEED_RUSAGE */
bool VacuumRunning = false;
-
-#ifdef VACUUM_QUIET
-static int MESSLEV = DEBUG;
-#else
-static int MESSLEV = NOTICE;
-#endif
+static int MESSLEV; /* message level */
typedef struct {
FuncIndexInfo finfo;
void
-vacuum(char *vacrel)
+vacuum(char *vacrel, bool verbose)
{
NameData VacRel;
+ if (verbose)
+ MESSLEV = NOTICE;
+ else
+ MESSLEV = DEBUG;
+
/* vacrel gets de-allocated on transaction commit */
/* initialize vacuum cleaner */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.23 1996/12/20 20:33:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.24 1997/01/13 03:44:18 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
expr_list, attrs, res_target_list, res_target_list2,
def_list, opt_indirection, group_clause, groupby_list, explain_options
-%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy, index_opt_unique
+%type <boolean> opt_inh_star, opt_binary, opt_instead, opt_with_copy,
+ index_opt_unique, opt_verbose
%type <ival> copy_dirn, archive_type, OptArchiveType, OptArchiveLocation,
def_type, opt_direction, remove_type, opt_column, event
RENAME, REPLACE, RETRIEVE, RETURNS, REVOKE, ROLLBACK, RULE,
SELECT, SET, SETOF, STDIN, STDOUT, STORE,
TABLE, TO, TRANSACTION, UNIQUE, UPDATE, USING, VACUUM, VALUES
- VERSION, VIEW, WHERE, WITH, WORK
+ VERBOSE, VERSION, VIEW, WHERE, WITH, WORK
%token EXECUTE, RECIPE, EXPLAIN, LIKE
/* Special keywords, not in the query language - see the "lex" file */
*
*****************************************************************************/
-VacuumStmt: VACUUM
+VacuumStmt: VACUUM opt_verbose
{
- $$ = (Node *)makeNode(VacuumStmt);
+ VacuumStmt *n = makeNode(VacuumStmt);
+ n->verbose = $2;
+ $$ = (Node *)n;
}
- | VACUUM relation_name
+ | VACUUM opt_verbose relation_name
{
VacuumStmt *n = makeNode(VacuumStmt);
- n->vacrel = $2;
+ n->verbose = $2;
+ n->vacrel = $3;
$$ = (Node *)n;
}
;
+opt_verbose: VERBOSE { $$ = TRUE; }
+ | /* EMPTY */ { $$ = FALSE; }
+ ;
+
/*****************************************************************************
*
* QUERY:
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/vacuum.l,v 1.2 1996/12/11 00:28:15 momjian Exp $
+.\" $Header: /cvsroot/pgsql/src/man/Attic/vacuum.l,v 1.3 1997/01/13 03:45:33 momjian Exp $
.TH VACUUM SQL 11/05/95 PostgreSQL PostgreSQL
.SH NAME
vacuum \(em vacuum a database
.SH SYNOPSIS
.nf
-\fBvacuum [table]\fP
+\fBvacuum [verbose] [\fPtable\fB]\fP
.fi
.SH DESCRIPTION
.BR Vacuum
.BR vacuum
periodically will increase Postgres's speed in processing user queries.
.PP
+\fBverbose\fP prints a detailed vacuum activity report for each table.
+.PP
The open database is the one that is vacuumed.
.PP
We recommend that production databases be vacuumed nightly, in order