VACUUMLO(1)
VACUUMLO(1) β¨ β orphaned large object cleanup, but make it fashion π
okay so bestie, welcome to vacuumlo β the PostgreSQL utility that literally sweeps up orphaned large objects from your database and it's giving housekeeping excellence π§Ήβ¨
SYNOPSIS π
vacuumlo [option...] dbname...
DESCRIPTION π
vacuumlo is a simple utility program (iconic, lowkey underrated) that removes any "orphaned" large objects from a PostgreSQL database. An orphaned large object (LO) is considered to be any LO whose OID does not appear in any oid or lo data column of the database. basically it's a whole LO with no home and no one checking for it π not on our watch!
If you use this, you may also be interested in the lo_manage trigger in the lo module. lo_manage is useful to try to avoid creating orphaned LOs in the first place. prevention era fr fr π«Ά
All databases named on the command line are processed. every single one. no skips. periodt π
OPTIONS β¨
vacuumlo accepts the following command-line arguments:
-l limit,--limit=limitβ Remove no more than limit large objects per transaction (default1000). Since the server acquires a lock per LO removed, removing too many LOs in one transaction risks exceedingmax_locks_per_transaction. Set the limit to zero if you want all removals done in a single transaction. one giant girlboss transaction, if you will π-n,--dry-runβ Don't remove anything, just show what would be done. it's giving window shopping ποΈ-v,--verboseβ Write a lot of progress messages. she's chatty and we love that for her πΈ-V,--versionβ Print thevacuumloversion and exit.-?,--helpβ Show help aboutvacuumlocommand line arguments, and exit.
vacuumlo also accepts the following command-line arguments for connection parameters:
-h host,--host=hostβ Database server's host.-p port,--port=portβ Database server's port.-U username,--username=usernameβ User name to connect as.-w,--no-passwordβ Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a.pgpassfile, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. no human, no problem π€-W,--passwordβ Forcevacuumloto prompt for a password before connecting to a database. This option is never essential, sincevacuumlowill automatically prompt for a password if the server demands password authentication. However,vacuumlowill waste a connection attempt finding out that the server wants a password. In some cases it is worth typing-Wto avoid the extra connection attempt. saves you a whole round trip, ngl kinda efficient π«
ENVIRONMENT π
PGHOST, PGPORT, PGUSER β Default connection parameters.
This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 34.15).
The environment variable PG_COLOR specifies whether to use color in diagnostic messages. Possible values are always, auto and never. yes bestie, aesthetic diagnostics are a thing π¨
NOTES π¦
vacuumlo works by the following method, and honestly the way this is engineered? ate π:
First, vacuumlo 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 oid or 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 β ik ik, read that again π). The remaining entries in the temporary table identify orphaned LOs. These are removed. mystery solved, case closed, slay π₯
AUTHOR π
Peter Mount <peter@retep.org.uk>
and that's the whole page bestie β brought to you by PostgreSQL 14.24, dated 2026, the year vacuumlo keeps the vibes immaculate πβ¨ go read the manpage, ily, bye! π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-contrib 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14-contrib 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14-contrib 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14-contrib 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms