Contents
vacuumlo
A contrib module for removing orphaned large objects
vacuumlo
is a contrib module providing a utility enabling the removal of orphaned large objects.
vacuumlo
was added in PostgreSQL 6.5.
Change history
- PostgreSQL 12
- options standardized to match those of core utilities, including addition of long options (commit bfea331a)
- PostgreSQL 9.2
- option
-l
added (initial commit b69f2e36)
- option
- PostgreSQL 8.4
- option
-w
/--no-password
added (commit 9de59fd1)
- option
- PostgreSQL 6.5
- added (commit 94bb87f9)
Note that the -l
option added in PostgreSQL 9.2 was also backported to PostgreSQL 9.0 (9.0.8) and PostgreSQL 9.1 (9.1.4).
Examples
Removal of a large object not associated with a table:
$ psql -c '\dl' Large objects ID | Owner | Description -------+----------+---------------------- 16459 | postgres | A small large object (1 row) $ vacuumlo -n postgres Connected to database "postgres" Test run: no large objects will be removed! Would remove 1 large objects from database "postgres". $ vacuumlo postgres $ psql -c '\dl' Large objects ID | Owner | Description ----+-------+------------- (0 rows)
Attempted removal of a large object associated with a table:
postgres=# CREATE TABLE lo_test (id SERIAL PRIMARY KEY, lo_oid OID); CREATE TABLE postgres=# \lo_import /tmp/hello-world.txt lo_import 16479 postgres=# INSERT INTO lo_test VALUES (DEFAULT, 16479); INSERT 0 1 postgres=# \q $ vacuumlo -n postgres Connected to database "postgres" Test run: no large objects will be removed! Checking lo_oid in public.lo_test Would remove 0 large objects from database "postgres".
References
- PostgreSQL documentation: vacuumlo