VACUUMLO(1)
π VACUUMLO(1) β the manual page, but make it a group chat π
okay bestie, so this is the vacuumlo page from the PostgreSQL 18.6 docs. it's short, it's iconic, and it's about yeeting orphaned large objects out of your database. let's get into it π«Ά
β¨ NAME β¨
vacuumlo β remove orphaned large objects from a PostgreSQL database π§Ήπ
β¨ SYNOPSIS β¨
vacuumlo [option...] dbname...
that's it. that's the whole vibe. options first, then one or more database names, no cap.
πΈ DESCRIPTION πΈ
so vacuumlo is a simple little utility program, and what it does is remove any "orphaned" large objects from a PostgreSQL database. and what's an orphaned large object (LO), you ask? it's literally any LO whose OID does not appear in any oid or lo data column of the database. like, nobody's holding its hand anymore. it's free-floating. it's giving abandoned. and vacuumlo is the friend that goes "okay we're cleaning this up" π§
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 queen π
All databases named on the command line are processed. all of them. every single one. no skipping π
π OPTIONS π
vacuumlo accepts the following command-line arguments:
-llimit,--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. π¨-n,--dry-runβ Don't remove anything, just show what would be done. a little preview, a little dress rehearsal, no actual deleting π-v,--verboseβ Write a lot of progress messages. she's chatty and we love that π£-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:
-hhost,--host=host β Database server's host.-pport,--port=port β Database server's port.-Uusername,--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. (bestie is running unattended, she cannot be asked for secrets π)-W,--passwordβ Forcevacuumloto prompt for a password before connecting to a database.- This option is never essential, since
vacuumlowill 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.
- This option is never essential, since
π ENVIRONMENT π
PGHOSTPGPORTPGUSER
Default connection parameters. yes, just those three, all lowercase, all vibes.
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. slay, even your errors can be pretty π¨β¨
π NOTES π
okay so here's the tea on how vacuumlo actually works β it's genuinely so clever:
- 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. ποΈβ¨
β οΈ Note: Only types with these names are considered; in particular, domains over them are not considered. so if you made a fancy domain type on top ofoidorlo, she does NOT see it. she said "i only knowoidandlo, i don't know her" π
π AUTHOR π
Peter Mount <peter@retep.org.uk> β the original main character, we thank her for her service π«‘π
PostgreSQL 18.6 Β· 2026 β that's the source and the date, bestie, and that's a wrap. go forth and de-orphan responsibly πΈπ¦π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18-contrib 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18-contrib 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18-contrib 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18-contrib 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms