OSDN Git Service

ab4c60551ff97438107ee9e5659fbd7ba7d1a3dd
[pg-rex/syncrep.git] / doc / src / sgml / vacuumlo.sgml
1 <!-- $PostgreSQL: pgsql/doc/src/sgml/vacuumlo.sgml,v 1.2 2007/12/06 04:12:10 tgl Exp $ -->
2
3 <sect1 id="vacuumlo">
4  <title>vacuumlo</title>
5
6  <indexterm zone="vacuumlo">
7   <primary>vacuumlo</primary>
8  </indexterm>
9
10  <para>
11   <application>vacuumlo</> is a simple utility program that will remove any
12   <quote>orphaned</> large objects from a
13   <productname>PostgreSQL</> database.  An orphaned large object (LO) is
14   considered to be any LO whose OID does not appear in any <type>oid</> or
15   <type>lo</> data column of the database.
16  </para>
17
18  <para>
19   If you use this, you may also be interested in the <function>lo_manage</>
20   trigger in <filename>contrib/lo</> (see <xref linkend="lo">).
21   <function>lo_manage</> is useful to try
22   to avoid creating orphaned LOs in the first place.
23  </para>
24
25  <sect2>
26   <title>Usage</title>
27
28   <synopsis>
29 vacuumlo [options] database [database2 ... databaseN]
30   </synopsis>
31
32   <para>
33    All databases named on the command line are processed.  Available options
34    include:
35   </para>
36
37   <variablelist>
38    <varlistentry>
39     <term><option>-v</option></term>
40     <listitem>
41      <para>Write a lot of progress messages</para>
42     </listitem>
43    </varlistentry>
44
45    <varlistentry>
46     <term><option>-n</option></term>
47     <listitem>
48      <para>Don't remove anything, just show what would be done</para>
49     </listitem>
50    </varlistentry>
51
52    <varlistentry>
53     <term><option>-U</option> <replaceable>username</></term>
54     <listitem>
55      <para>Username to connect as</para>
56     </listitem>
57    </varlistentry>
58
59    <varlistentry>
60     <term><option>-W</option></term>
61     <listitem>
62      <para>Force prompt for password (generally useless)</para>
63     </listitem>
64    </varlistentry>
65
66    <varlistentry>
67     <term><option>-h</option> <replaceable>hostname</></term>
68     <listitem>
69      <para>Database server's host</para>
70     </listitem>
71    </varlistentry>
72
73    <varlistentry>
74     <term><option>-p</option> <replaceable>port</></term>
75     <listitem>
76      <para>Database server's port</para>
77     </listitem>
78    </varlistentry>
79   </variablelist>
80  </sect2>
81
82  <sect2>
83   <title>Method</title>
84
85   <para>
86    First, it builds a temporary table which contains all of the OIDs of the
87    large objects in that database.
88   </para>
89
90   <para>
91    It then scans through all columns in the database that are of type
92    <type>oid</> or <type>lo</>, and removes matching entries from the
93   temporary table.
94   </para>
95
96   <para>
97    The remaining entries in the temp table identify orphaned LOs.
98    These are removed.
99   </para>
100  </sect2>
101
102  <sect2>
103   <title>Author</title>
104
105   <para>
106    Peter Mount <email>peter@retep.org.uk</email>
107   </para>
108  </sect2>
109
110 </sect1>