VACUUMLO(1)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸ’… 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 the lo_manage trigger in the lo module πŸ‘€ β€” lo_manage is 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:

  • -l limit, --limit=limit β€” remove no more than limit large objects per transaction (default 1000). and like, why? because the server acquires a lock per LO removed, so removing too many LOs in one transaction risks exceeding max_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 the vacuumlo version and exit.
  • -?, --help β€” show help about vacuumlo command line arguments, and exit.

πŸ”Œ connection parameter args πŸ”Œ

vacuumlo also accepts the following command-line arguments for connection parameters:

  • -h host, --host=host β€” database server's host. where she lives 🏠
  • -p port, --port=port β€” database server's port.
  • -U username, --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 .pgpass file, 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 β€” force vacuumlo to 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 πŸ’œ

  • PGHOST
  • PGPORT
  • PGUSER

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:

  1. first, vacuumlo builds a temporary table which contains all of the OIDs of the large objects in the selected database.
  2. then it 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. ⚠️ read that twice, bestie. domains? not invited to the party. 🚫
  1. 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 πŸ’–βœ¨πŸŽ€