Skip to content

Commit 4f9269c

Browse files
committed
Improvements to the install section of the docs
Fixed cleanup procedure with EXTENSION, added uninstall section.
1 parent 673a8ea commit 4f9269c

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

doc/pg_repack.rst

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ You can choose one of the following methods to reorganize:
5959
NOTICE:
6060

6161
* Only superusers can use the utility.
62-
* Target table must have PRIMARY KEY.
62+
* Target table must have a PRIMARY KEY, or at least a UNIQUE total index on a
63+
NOT NULL column.
6364

6465
.. _pg_repack: http://reorg.github.com/pg_repack
6566
.. _project page: https://github.com/reorg/pg_repack
@@ -195,10 +196,13 @@ Diagnostics
195196
Error messages are reported when pg_repack fails. The following list shows the
196197
cause of errors.
197198

198-
You need to cleanup by hand after fatal errors. To cleanup, execute
199-
``$PGHOME/share/contrib/uninstall_pg_repack.sql`` to the database where the
200-
error occured and then execute ``$PGHOME/share/contrib/pg_repack.sql``. (Do
201-
uninstall and reinstall.)
199+
You need to cleanup by hand after fatal errors. To cleanup, just remove
200+
pg_repack from the database and install it again: for PostgreSQL 9.1 and
201+
following execute ``DROP EXTENSION pg_repack CASCADE`` in the database where
202+
the error occurred, followed by ``CREATE EXTENSION pg_repack``; for previous
203+
version load the script ``$SHAREDIR/contrib/uninstall_pg_repack.sql`` into the
204+
database where the error occured and then load
205+
``$SHAREDIR/contrib/pg_repack.sql`` again.
202206

203207
pg_repack: repack database "template1" ... skipped
204208
pg_repack is not installed in the database when ``--all`` option is
@@ -290,33 +294,42 @@ table. Then, it updates the system catalogs directly to swap the work table
290294
and the original one.
291295

292296

293-
Installations
294-
-------------
297+
Installation
298+
------------
295299

296-
pg_repack can be built with "make" on UNIX or Linux. pgxs build framework is
297-
used automatically. Before building, you might need to install postgres
298-
packages for developer (postgresql-devel, etc.) and add ``pg_config`` to your
299-
``$PATH``. ::
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::
300304

301305
$ cd pg_repack
302306
$ make
303-
$ su
304-
$ make install
307+
$ sudo make install
305308

306309
You can also use Microsoft Visual C++ 2010 to build the program on Windows.
307310
There are project files in the ``msvc`` folder.
308311

309-
Install the pg_repack extension in the database you want to process. On
310-
PostgreSQL 9.1 or following pg_repack is packaged as an extension::
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::
311315

312316
$ psql -c "CREATE EXTENSION pg_repack" -d your_database
313317

314-
For previous PostgreSQL versions you should load the script ``pg_repack.sql``
315-
that can be found in the ``contrib`` subdirectory of the directory reported by
316-
``--pg_config sharedir``, e.g. ::
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. ::
317321

318322
$ psql -f "$(pg_config --sharedir)/contrib/pg_repack.sql" -d your_database
319323

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+
320333

321334
Requirements
322335
------------

0 commit comments

Comments
 (0)