3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "VACUUMLO" "1" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 vacuumlo \- remove orphaned large objects from a PostgreSQL database
33 .HP \w'\fBvacuumlo\fR\ 'u
34 \fBvacuumlo\fR [\fIoption\fR...] \fIdbname\fR...
38 is a simple utility program that will remove any
42 database\&. An orphaned large object (LO) is considered to be any LO whose OID does not appear in any
46 data column of the database\&.
48 If you use this, you may also be interested in the
54 is useful to try to avoid creating orphaned LOs in the first place\&.
56 All databases named on the command line are processed\&.
60 accepts the following command\-line arguments:
62 \fB\-l \fR\fB\fIlimit\fR\fR
64 \fB\-\-limit=\fR\fB\fIlimit\fR\fR
68 large objects per transaction (default 1000)\&. Since the server acquires a lock per LO removed, removing too many LOs in one transaction risks exceeding
69 max_locks_per_transaction\&. Set the limit to zero if you want all removals done in a single transaction\&.
76 Don\*(Aqt remove anything, just show what would be done\&.
83 Write a lot of progress messages\&.
101 command line arguments, and exit\&.
105 also accepts the following command\-line arguments for connection parameters:
107 \fB\-h \fR\fB\fIhost\fR\fR
109 \fB\-\-host=\fR\fB\fIhost\fR\fR
111 Database server\*(Aqs host\&.
114 \fB\-p \fR\fB\fIport\fR\fR
116 \fB\-\-port=\fR\fB\fIport\fR\fR
118 Database server\*(Aqs port\&.
121 \fB\-U \fR\fB\fIusername\fR\fR
123 \fB\-\-username=\fR\fB\fIusername\fR\fR
125 User name to connect as\&.
130 \fB\-\-no\-password\fR
132 Never issue a password prompt\&. If the server requires password authentication and a password is not available by other means such as a
134 file, the connection attempt will fail\&. This option can be useful in batch jobs and scripts where no user is present to enter a password\&.
143 to prompt for a password before connecting to a database\&.
145 This option is never essential, since
147 will automatically prompt for a password if the server demands password authentication\&. However,
149 will waste a connection attempt finding out that the server wants a password\&. In some cases it is worth typing
151 to avoid the extra connection attempt\&.
161 Default connection parameters\&.
164 This utility, like most other
166 utilities, also uses the environment variables supported by
171 The environment variable
173 specifies whether to use color in diagnostic messages\&. Possible values are
181 works by the following method: First,
183 builds a temporary table which contains all of the OIDs of the large objects in the selected database\&. It then scans through all columns in the database that are of type
186 lo, and removes matching entries from the temporary table\&. (Note: Only types with these names are considered; in particular, domains over them are not considered\&.) The remaining entries in the temporary table identify orphaned LOs\&. These are removed\&.
190 <peter@retep\&.org\&.uk>