Add TRUNCATE parameter to VACUUM.
authorFujii Masao <fujii@postgresql.org>
Tue, 7 May 2019 17:10:33 +0000 (02:10 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 7 May 2019 17:10:33 +0000 (02:10 +0900)
commitb84dbc8eb80b43e554891c459a19969d9fbdefe5
tree3005b4dc1ca54c9ce9fd3c2d24b69ec12b680111
parent98719af6c2e30d538cd05cfe044f58ba4067b52b
Add TRUNCATE parameter to VACUUM.

This commit adds new parameter to VACUUM command, TRUNCATE,
which specifies that VACUUM should attempt to truncate off
any empty pages at the end of the table and allow the disk space
for the truncated pages to be returned to the operating system.

This parameter, if specified, overrides the vacuum_truncate
reloption. If neither the reloption nor the VACUUM option is
used, the default is true, as before.

Author: Fujii Masao
Reviewed-by: Julien Rouhaud, Masahiko Sawada
Discussion: https://postgr.es/m/CAD21AoD+qtrSDL=GSma4Wd3kLYLeRC0hPna-YAdkDeV4z156vg@mail.gmail.com
doc/src/sgml/ref/create_table.sgml
doc/src/sgml/ref/vacuum.sgml
src/backend/access/heap/vacuumlazy.c
src/backend/commands/vacuum.c
src/backend/postmaster/autovacuum.c
src/bin/psql/tab-complete.c
src/include/commands/vacuum.h
src/test/regress/expected/vacuum.out
src/test/regress/sql/vacuum.sql