The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / vacuumlo.sgml
blobee35a2445c5ce3c935b2f8c0f1b989fd78670e18
1 <!-- $PostgreSQL$ -->
3 <sect1 id="vacuumlo">
4 <title>vacuumlo</title>
6 <indexterm zone="vacuumlo">
7 <primary>vacuumlo</primary>
8 </indexterm>
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>
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>
25 <sect2>
26 <title>Usage</title>
28 <synopsis>
29 vacuumlo [options] database [database2 ... databaseN]
30 </synopsis>
32 <para>
33 All databases named on the command line are processed. Available options
34 include:
35 </para>
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>
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>
52 <varlistentry>
53 <term><option>-U</option> <replaceable>username</></term>
54 <listitem>
55 <para>Username to connect as.</para>
56 </listitem>
57 </varlistentry>
59 <varlistentry>
60 <term><option>-w</></term>
61 <term><option>--no-password</></term>
62 <listitem>
63 <para>
64 Never issue a password prompt. If the server requires password
65 authentication and a password is not available by other means
66 such as a <filename>.pgpass</filename> file, the connection
67 attempt will fail. This option can be useful in batch jobs and
68 scripts where no user is present to enter a password.
69 </para>
70 </listitem>
71 </varlistentry>
73 <varlistentry>
74 <term><option>-W</option></term>
75 <listitem>
76 <para>
77 Force <application>vacuumlo</application> to prompt for a
78 password before connecting to a database.
79 </para>
81 <para>
82 This option is never essential, since
83 <application>vacuumlo</application> will automatically prompt
84 for a password if the server demands password authentication.
85 However, <application>vacuumlo</application> will waste a
86 connection attempt finding out that the server wants a password.
87 In some cases it is worth typing <option>-W</> to avoid the extra
88 connection attempt.
89 </para>
90 </listitem>
91 </varlistentry>
93 <varlistentry>
94 <term><option>-h</option> <replaceable>hostname</></term>
95 <listitem>
96 <para>Database server's host.</para>
97 </listitem>
98 </varlistentry>
100 <varlistentry>
101 <term><option>-p</option> <replaceable>port</></term>
102 <listitem>
103 <para>Database server's port.</para>
104 </listitem>
105 </varlistentry>
106 </variablelist>
107 </sect2>
109 <sect2>
110 <title>Method</title>
112 <para>
113 First, it builds a temporary table which contains all of the OIDs of the
114 large objects in that database.
115 </para>
117 <para>
118 It then scans through all columns in the database that are of type
119 <type>oid</> or <type>lo</>, and removes matching entries from the
120 temporary table.
121 </para>
123 <para>
124 The remaining entries in the temp table identify orphaned LOs.
125 These are removed.
126 </para>
127 </sect2>
129 <sect2>
130 <title>Author</title>
132 <para>
133 Peter Mount <email>peter@retep.org.uk</email>
134 </para>
135 </sect2>
137 </sect1>