VACUUMLO(1)
π VACUUMLO(1) π
ok so this is straight out of the PostgreSQL 15.19 Documentation, bestie β the vacuumlo page, and honestly? she's lowkey a lifesaver π§β¨
β¨ NAME β¨
vacuumlo β like, it removes orphaned large objects from a PostgreSQL database. that's the whole vibe. π
πΈ SYNOPSIS πΈ
vacuumlo [option...] dbname...
π¦ DESCRIPTION π¦
okay so vacuumlo is this simple little utility program that goes in and removes any "orphaned" large objects from a PostgreSQL database. iconic behaviour, no cap. π
and what counts as an orphaned large object (LO), you ask? literally any LO whose OID does not appear in any oid or lo data column of the database. that's it. if nobody's claiming it, she's getting evicted. π
hot tip from your girl: if you're using this, you might also be interested in thelo_managetrigger in thelomodule π βlo_manageis useful to try to avoid creating orphaned LOs in the first place. prevention over cleanup, iykyk. β¨
and yes β all databases named on the command line are processed. every single one. she's thorough. π
π OPTIONS π
vacuumlo accepts the following command-line arguments, babes:
-llimit,--limit=limitβ remove no more than limit large objects per transaction (default1000). and like, why? because the server acquires a lock per LO removed, so 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. bold move, respect. π-n,--dry-runβ don't remove anything, just show what would be done. window shopping fr fr ποΈ-v,--verboseβ write a lot of progress messages. she's a talker and we love her for it π£οΈπ-V,--versionβ print thevacuumloversion and exit.-?,--helpβ show help aboutvacuumlocommand line arguments, and exit.
π connection parameter args π
vacuumlo also accepts the following command-line arguments for connection parameters:
-hhost,--host=hostβ database server's host. where she lives π-pport,--port=portβ database server's port.-Uusername,--username=usernameβ user name to connect as. main character energy, pick wisely π-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. yes, she will simply not ask. ghosted. π-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. literally just save yourself the round trip, bestie π«Ά
π ENVIRONMENT π
PGHOSTPGPORTPGUSER
those are your default connection parameters π«
this utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 34.15). yes, all of them. she's connected like that. π
the environment variable PG_COLOR specifies whether to use color in diagnostic messages. possible values are always, auto and never. aesthetic choices only π
π¨
π₯ NOTES π₯
okay so here's how vacuumlo actually works, step by step β because the way that she does it is honestly so smart:
- first,
vacuumlobuilds a temporary table which contains all of the OIDs of the large objects in the selected database. - then it scans through all columns in the database that are of type
oidorlo, and removes matching entries from the temporary table.
Note: Only types with these names are considered; in particular, domains over them are not considered. β οΈ read that twice, bestie. domains? not invited to the party. π«
- the remaining entries in the temporary table identify orphaned LOs. and those? those are removed. bye-bye πβ¨
π AUTHOR π
Peter Mount <peter@retep.org.uk> β legend behaviour, we stan π«Άπ
and that's the page!! π¦ this version is living in PostgreSQL 15.19 land, dated 2026, filed under VACUUMLO(1) β mwah, go clean up those orphans, you've got this πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-contrib 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-contrib 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-contrib 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-contrib 15.19-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