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

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".

Categories

Contrib module, Large object, Vacuuming

See also

large object, lo