OSDN Git Service

Cleanup the contrib/lo module: there is no need anymore to implement
[pg-rex/syncrep.git] / contrib / vacuumlo / README.vacuumlo
1 $PostgreSQL: pgsql/contrib/vacuumlo/README.vacuumlo,v 1.5 2005/06/23 00:06:37 tgl Exp $
2
3 This is a simple utility that will remove any orphaned large objects out of a
4 PostgreSQL database.  An orphaned LO is considered to be any LO whose OID
5 does not appear in any OID data column of the database.
6
7 If you use this, you may also be interested in the lo_manage trigger in
8 contrib/lo.  lo_manage is useful to try to avoid creating orphaned LOs
9 in the first place.
10
11
12 Compiling
13 --------
14
15 Simply run make. A single executable "vacuumlo" is created.
16
17
18 Usage
19 -----
20
21 vacuumlo [options] database [database2 ... databasen]
22
23 All databases named on the command line are processed.  Available options
24 include:
25
26   -v            Write a lot of progress messages
27   -n            Don't remove large objects, just show what would be done
28   -U username   Username to connect as
29   -W            Prompt for password
30   -h hostname   Database server host
31   -p port       Database server port
32
33
34 Method
35 ------
36
37 First, it builds a temporary table which contains all of the OIDs of the
38 large objects in that database.
39
40 It then scans through all columns in the database that are of type "oid"
41 or "lo", and removes matching entries from the temporary table.
42
43 The remaining entries in the temp table identify orphaned LOs.  These are
44 removed.
45
46
47 Notes
48 -----
49
50 I decided to place this in contrib as it needs further testing, but hopefully,
51 this (or a variant of it) would make it into the backend as a "vacuum lo"
52 command in a later release.
53
54 Peter Mount <peter@retep.org.uk>
55 http://www.retep.org.uk
56 March 21 1999
57
58 Committed April 10 1999 Peter