@@ -59,7 +59,8 @@ You can choose one of the following methods to reorganize:
59
59
NOTICE:
60
60
61
61
* 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.
63
64
64
65
.. _pg_repack : http://reorg.github.com/pg_repack
65
66
.. _project page : https://github.com/reorg/pg_repack
@@ -195,10 +196,13 @@ Diagnostics
195
196
Error messages are reported when pg_repack fails. The following list shows the
196
197
cause of errors.
197
198
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.
202
206
203
207
pg_repack: repack database "template1" ... skipped
204
208
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
290
294
and the original one.
291
295
292
296
293
- Installations
294
- -------------
297
+ Installation
298
+ ------------
295
299
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 ::
300
304
301
305
$ cd pg_repack
302
306
$ make
303
- $ su
304
- $ make install
307
+ $ sudo make install
305
308
306
309
You can also use Microsoft Visual C++ 2010 to build the program on Windows.
307
310
There are project files in the ``msvc `` folder.
308
311
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::
311
315
312
316
$ psql -c "CREATE EXTENSION pg_repack" -d your_database
313
317
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. ::
317
321
318
322
$ psql -f "$(pg_config --sharedir)/contrib/pg_repack.sql" -d your_database
319
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
+
320
333
321
334
Requirements
322
335
------------
0 commit comments