Skip to content

Commit ef2c7da

Browse files
committed
Doc page reordered in a more logical order
Requirements, Installation, Usage, Examples, etc.
1 parent 4f9269c commit ef2c7da

File tree

1 file changed

+92
-102
lines changed

1 file changed

+92
-102
lines changed

doc/pg_repack.rst

Lines changed: 92 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,13 @@ pg_repack -- Reorganize tables in PostgreSQL databases without any locks
55
:depth: 1
66
:backlinks: none
77

8-
Synopsis
9-
--------
10-
11-
::
12-
13-
pg_repack [OPTION]... [DBNAME]
14-
15-
The following options can be specified in ``OPTIONS``. See also Options_ for
16-
details.
17-
18-
Options:
19-
-a, --all repack all databases
20-
-n, --no-order do vacuum full instead of cluster
21-
-o, --order-by=COLUMNS order by columns instead of cluster keys
22-
-t, --table=TABLE repack specific table only
23-
-T, --wait-timeout=SECS timeout to cancel other backends on conflict
24-
-Z, --no-analyze don't analyze at end
25-
26-
Connection options:
27-
-d, --dbname=DBNAME database to connect
28-
-h, --host=HOSTNAME database server host or socket directory
29-
-p, --port=PORT database server port
30-
-U, --username=USERNAME user name to connect as
31-
-w, --no-password never prompt for password
32-
-W, --password force password prompt
33-
34-
Generic options:
35-
-e, --echo echo queries
36-
-E, --elevel=LEVEL set output message level
37-
--help show this help, then exit
38-
--version output version information, then exit
39-
40-
41-
Description
42-
-----------
438

449
pg_repack_ is an utility program to reorganize tables in PostgreSQL databases.
4510
Unlike clusterdb_, it doesn't block any selections and updates during
4611
reorganization.
4712

48-
pg_repack is a fork of the previous pg_reorg_ project. It was founded to
49-
gather the bug fixes and new development ideas that the slow pace of
50-
development of pg_reorg was struggling to satisfy. Please check the `project
51-
page`_ for bug report and development information.
13+
pg_repack is a fork of the previous pg_reorg_ project. Please check the
14+
`project page`_ for bug report and development information.
5215

5316
You can choose one of the following methods to reorganize:
5417

@@ -68,24 +31,89 @@ NOTICE:
6831
.. _pg_reorg: http://reorg.projects.pgfoundry.org/
6932

7033

71-
Examples
72-
--------
34+
Requirements
35+
------------
7336

74-
Execute the following command to perform an online CLUSTER of all tables in
75-
test database::
37+
PostgreSQL versions
38+
PostgreSQL 8.3, 8.4, 9.0, 9.1, 9.2
7639

77-
$ pg_repack test
40+
OS
41+
RHEL 5.2, Windows XP SP3
7842

79-
Execute the following command to perform an online VACUUM FULL to foo table in
80-
test database::
43+
Disks
44+
Requires free disk space twice as large as the target table(s) and
45+
indexes. For example, if the total size of the tables and indexes to be
46+
reorganized is 1GB, an additional 2GB of disk space is required.
8147

82-
$ pg_repack --no-order --table foo -d test
8348

49+
Installation
50+
------------
51+
52+
pg_repack can be built with ``make`` on UNIX or Linux. The PGXS build
53+
framework is used automatically. Before building, you might need to install
54+
the PostgreSQL development packages (``postgresql-devel``, etc.) and add the
55+
directory containing ``pg_config`` to your ``$PATH``. Then you can run::
8456

85-
Options
86-
-------
57+
$ cd pg_repack
58+
$ make
59+
$ sudo make install
60+
61+
You can also use Microsoft Visual C++ 2010 to build the program on Windows.
62+
There are project files in the ``msvc`` folder.
63+
64+
After installation, load the pg_repack extension in the database you want to
65+
process. On PostgreSQL 9.1 and following pg_repack is packaged as an
66+
extension, so you can execute::
67+
68+
$ psql -c "CREATE EXTENSION pg_repack" -d your_database
69+
70+
For previous PostgreSQL versions you should load the script
71+
``$SHAREDIR/contrib/pg_repack.sql`` in the database to process; you can
72+
get ``$SHAREDIR`` using ``pg_config --sharedir``, e.g. ::
73+
74+
$ psql -f "$(pg_config --sharedir)/contrib/pg_repack.sql" -d your_database
75+
76+
You can remove pg_repack from a PostgreSQL 9.1 and following database using
77+
``DROP EXTENSION pg_repack``. For previous Postgresql versions load the
78+
``$SHAREDIR/contrib/uninstall_pg_repack.sql`` script or just drop the
79+
``repack`` schema.
80+
81+
If you are upgrading from a previous version of pg_repack or pg_reorg, just
82+
drop the old version from the database as explained above and install the new
83+
version.
84+
85+
86+
Usage
87+
-----
88+
89+
::
90+
91+
pg_repack [OPTION]... [DBNAME]
92+
93+
The following options can be specified in ``OPTIONS``.
94+
95+
Options:
96+
-a, --all repack all databases
97+
-n, --no-order do vacuum full instead of cluster
98+
-o, --order-by=COLUMNS order by columns instead of cluster keys
99+
-t, --table=TABLE repack specific table only
100+
-T, --wait-timeout=SECS timeout to cancel other backends on conflict
101+
-Z, --no-analyze don't analyze at end
102+
103+
Connection options:
104+
-d, --dbname=DBNAME database to connect
105+
-h, --host=HOSTNAME database server host or socket directory
106+
-p, --port=PORT database server port
107+
-U, --username=USERNAME user name to connect as
108+
-w, --no-password never prompt for password
109+
-W, --password force password prompt
110+
111+
Generic options:
112+
-e, --echo echo queries
113+
-E, --elevel=LEVEL set output message level
114+
--help show this help, then exit
115+
--version output version information, then exit
87116

88-
pg_repack has the following command line options:
89117

90118
Reorg Options
91119
^^^^^^^^^^^^^
@@ -190,6 +218,20 @@ Environment
190218
.. __: http://www.postgresql.org/docs/current/static/libpq-envars.html
191219

192220

221+
Examples
222+
--------
223+
224+
Execute the following command to perform an online CLUSTER of all tables in
225+
test database::
226+
227+
$ pg_repack test
228+
229+
Execute the following command to perform an online VACUUM FULL to foo table in
230+
test database::
231+
232+
$ pg_repack --no-order --table foo -d test
233+
234+
193235
Diagnostics
194236
-----------
195237

@@ -294,58 +336,6 @@ table. Then, it updates the system catalogs directly to swap the work table
294336
and the original one.
295337

296338

297-
Installation
298-
------------
299-
300-
pg_repack can be built with ``make`` on UNIX or Linux. The PGXS build
301-
framework is used automatically. Before building, you might need to install
302-
the PostgreSQL development packages (``postgresql-devel``, etc.) and add the
303-
directory containing ``pg_config`` to your ``$PATH``. Then you can run::
304-
305-
$ cd pg_repack
306-
$ make
307-
$ sudo make install
308-
309-
You can also use Microsoft Visual C++ 2010 to build the program on Windows.
310-
There are project files in the ``msvc`` folder.
311-
312-
After installation, load the pg_repack extension in the database you want to
313-
process. On PostgreSQL 9.1 and following pg_repack is packaged as an
314-
extension, so you can execute::
315-
316-
$ psql -c "CREATE EXTENSION pg_repack" -d your_database
317-
318-
For previous PostgreSQL versions you should load the script
319-
``$SHAREDIR/contrib/pg_repack.sql`` in the database to process; you can
320-
get ``$SHAREDIR`` using ``pg_config --sharedir``, e.g. ::
321-
322-
$ psql -f "$(pg_config --sharedir)/contrib/pg_repack.sql" -d your_database
323-
324-
You can remove pg_repack from a PostgreSQL 9.1 and following database using
325-
``DROP EXTENSION pg_repack``. For previous Postgresql versions load the
326-
``$SHAREDIR/contrib/uninstall_pg_repack.sql`` script or just drop the
327-
``repack`` schema.
328-
329-
If you are upgrading from a previous version of pg_repack or pg_reorg, just
330-
drop the old version from the database as explained above and install the new
331-
version.
332-
333-
334-
Requirements
335-
------------
336-
337-
PostgreSQL versions
338-
PostgreSQL 8.3, 8.4, 9.0, 9.1, 9.2
339-
340-
OS
341-
RHEL 5.2, Windows XP SP3
342-
343-
Disks
344-
Requires free disk space twice as large as the target table(s) and
345-
indexes. For example, if the total size of the tables and indexes to be
346-
reorganized is 1GB, an additional 2GB of disk space is required.
347-
348-
349339
Releases
350340
--------
351341

0 commit comments

Comments
 (0)