-
Notifications
You must be signed in to change notification settings - Fork 7
Manual
schmiddy edited this page Oct 15, 2012
·
3 revisions
pg_reorg -- Reorganize tables in a PostgreSQL database without holding locks.
pg_reorg [OPTIONS]
The following options can be specified in OPTIONS. See also "Options" for details.
- -o [--order-by] columns [,...]
- -n [--no-order]
- -t [--table] table
- -T [--wait-timeout] seconds
- -Z [--no-analyze]
- -a, --all : reorganize all databases
- -d, --dbname=DBNAME : database to connect
- -h, --host=HOSTNAME : database server host or socket directory
- -p, --port=PORT : database server port
- -U, --username=USERNAME : user name to connect as
- -w, --no-password : never prompt for password
- -W, --password : force password prompt
- -e, --echo : echo queries
- -E, --elevel=LEVEL : set output message level
- --help : show the help, then exit
- --version : output version information, then exit
pg_reorg is an utility program to reorganize tables in PostgreSQL databases. Unlike clusterdb, it doesn't block concurrent DML (i.e. SELECTs or UPDATEs) of the table while it is being compacted. You can choose one of the following methods to reorganize.
- Online CLUSTER (ordered by cluster index)
- Ordered by specified columns
- Online VACUUM FULL (packing rows only)
NOTICE:
- Only superusers can use the utility.
- Target table must have PRIMARY KEY.
The following invocation performs an online CLUSTER of all tables in the test database.
$ pg_reorg test
The following invocation performs an online VACUUM FULL of table foo in the test database.
$ pg_reorg --no-order --table foo -d test
pg_reorg has the following command line options: