VACUUMLO(1)
π VACUUMLO(1) β the vacuumlo girlies' guide
okay bestie, so this is vacuumlo, and it lives in the PostgreSQL 17.11 documentation corner of the universe. it's a little utility with one job and she does it well. let's get into it π«Ά
β¨ NAME β¨
vacuumlo β literally just here to yeet orphaned large objects out of a PostgreSQL database. that's it. that's the whole gig π
πΈ SYNOPSIS πΈ
vacuumlo [option...] dbname...
π DESCRIPTION π
okay so vacuumlo is a simple utility program, and what she does is remove any "orphaned" large objects from a PostgreSQL database. and what counts as an orphaned large object (LO)? π any LO whose OID does not show up in any oid or lo data column of the database. like, nobody's claiming her, she's out here on her own, and vacuumlo has come to collect.
if you use this, you may also be interested in the lo_manage trigger in the lo module β because lo_manage is the one that's useful for trying to avoid creating orphaned LOs in the first place. prevention icon behavior, honestly π
also, all databases named on the command line are processed. every single one. she doesn't pick favorites π
β¨ OPTIONS β¨
vacuumlo accepts the following command-line arguments:
-l limit,--limit=limitβ remove no more than limit large objects per transaction (default1000). the tea here π΅ is that since the server acquires a lock per LO removed, removing too many LOs in one transaction risks exceedingmax_locks_per_transaction. so set the limit to zero if you want all removals done in a single transaction. (yes really, zero means go off π)-n,--dry-runβ don't remove anything, just show what would be done. a little peek behind the curtain, no commitment, we love a look-but-don't-touch moment π-v,--verboseβ write a lot of progress messages. she's a talker and honestly? relatable π-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. fr fr, set it and forget it π§-W,--passwordβ forcevacuumloto prompt for a password before connecting to a database.
this option is never essential, since vacuumlo will automatically prompt for a password if the server demands password authentication. however, vacuumlo will waste a connection attempt finding out that the server wants a password. in some cases it is worth typing -W to avoid the extra connection attempt. lowkey an efficiency hack, highkey worth knowing β
π¦ ENVIRONMENT π¦
PGHOSTPGPORTPGUSER
default connection parameters. the usual suspects π
this utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 32.15).
the environment variable PG_COLOR specifies whether to use color in diagnostic messages. possible values are always, auto and never. aesthetic diagnostics, we stan πΈ
π₯ NOTES π₯
okay so here's the method behind the magic, because the way that vacuumlo works is genuinely kinda iconic:
- first,
vacuumlobuilds 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
oidorlo, and removes matching entries from the temporary table. - the remaining entries in the temporary table identify orphaned LOs. these are removed. bye bestie π
note: only types with these names are considered; in particular, domains over them are not considered. so if you thought your cute domain type was gonna count β it's not. π
π AUTHOR π
Peter Mount <peter@retep.org.uk>
and that's the whole page, bestie β no cap, nothing skipped, every flag accounted for. this one shipped as part of PostgreSQL 17.11, dated 2026, and it's giving timeless utility realness. go forth and de-orphan responsibly πβ¨π¦
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-contrib 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17-contrib 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17-contrib 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17-contrib 17.11-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