4 vacuumlo — remove orphaned large objects from a PostgreSQL database
8 vacuumlo [option...] dbname...
12 vacuumlo is a simple utility program that will remove any “orphaned”
13 large objects from a PostgreSQL database. An orphaned large object (LO)
14 is considered to be any LO whose OID does not appear in any oid or lo
15 data column of the database.
17 If you use this, you may also be interested in the lo_manage trigger in
18 the lo module. lo_manage is useful to try to avoid creating orphaned
19 LOs in the first place.
21 All databases named on the command line are processed.
25 vacuumlo accepts the following command-line arguments:
29 Remove no more than limit large objects per transaction (default
30 1000). Since the server acquires a lock per LO removed, removing
31 too many LOs in one transaction risks exceeding
32 max_locks_per_transaction. Set the limit to zero if you want all
33 removals done in a single transaction.
37 Don't remove anything, just show what would be done.
41 Write a lot of progress messages.
45 Print the vacuumlo version and exit.
49 Show help about vacuumlo command line arguments, and exit.
51 vacuumlo also accepts the following command-line arguments for
52 connection parameters:
56 Database server's host.
60 Database server's port.
64 User name to connect as.
68 Never issue a password prompt. If the server requires password
69 authentication and a password is not available by other means
70 such as a .pgpass file, the connection attempt will fail. This
71 option can be useful in batch jobs and scripts where no user is
72 present to enter a password.
76 Force vacuumlo to prompt for a password before connecting to a
79 This option is never essential, since vacuumlo will
80 automatically prompt for a password if the server demands
81 password authentication. However, vacuumlo will waste a
82 connection attempt finding out that the server wants a password.
83 In some cases it is worth typing -W to avoid the extra
91 Default connection parameters.
93 This utility, like most other PostgreSQL utilities, also uses the
94 environment variables supported by libpq (see Section 32.15).
96 The environment variable PG_COLOR specifies whether to use color in
97 diagnostic messages. Possible values are always, auto and never.
101 vacuumlo works by the following method: First, vacuumlo builds a
102 temporary table which contains all of the OIDs of the large objects in
103 the selected database. It then scans through all columns in the
104 database that are of type oid or lo, and removes matching entries from
105 the temporary table. (Note: Only types with these names are considered;
106 in particular, domains over them are not considered.) The remaining
107 entries in the temporary table identify orphaned LOs. These are
112 Peter Mount <peter@retep.org.uk>