VACUUMLO(1)

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

πŸ’… 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 (default 1000). the tea here 🍡 is that since the server acquires a lock per LO removed, removing too many LOs in one transaction risks exceeding max_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 the vacuumlo version and exit.
  • -?, --help β€” show help about vacuumlo command 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 .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. fr fr, set it and forget it 🧚
  • -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. lowkey an efficiency hack, highkey worth knowing ⭐


πŸ¦‹ ENVIRONMENT πŸ¦‹

  • PGHOST
  • PGPORT
  • PGUSER

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:

  1. first, vacuumlo builds a temporary table which contains all of the OIDs of the large objects in the selected database.
  2. it then scans through all columns in the database that are of type oid or lo, and removes matching entries from the temporary table.
  3. 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 πŸŽ€βœ¨πŸ¦‹