Rationalize vacuuming options and parameters
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 18 Mar 2015 14:52:33 +0000 (11:52 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 18 Mar 2015 14:52:33 +0000 (11:52 -0300)
commit0d831389749a3baaced7b984205b9894a82444b9
treeca6bd7f632c9300cadbe66dc60f32a60231828fc
parent4559167c6b75be334fabad70d7cc03a38a08d494
Rationalize vacuuming options and parameters

We were involving the parser too much in setting up initial vacuuming
parameters.  This patch moves that responsibility elsewhere to simplify
code, and also to make future additions easier.  To do this, create a
new struct VacuumParams which is filled just prior to vacuum execution,
instead of at parse time; for user-invoked vacuuming this is set up in a
new function ExecVacuum, while autovacuum sets it up by itself.

While at it, add a new member VACOPT_SKIPTOAST to enum VacuumOption,
only set by autovacuum, which is used to disable vacuuming of the toast
table instead of the old do_toast parameter; this relieves the argument
list of vacuum() and some callees a bit.  This partially makes up for
having added more arguments in an effort to avoid having autovacuum from
constructing a VacuumStmt parse node.

Author: Michael Paquier. Some tweaks by Álvaro
Reviewed by: Robert Haas, Stephen Frost, Álvaro Herrera
src/backend/commands/analyze.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/backend/postmaster/autovacuum.c
src/backend/tcop/utility.c
src/include/commands/vacuum.h
src/include/nodes/parsenodes.h