postgres/contrib/vacuumlo
PostgreSQL Daemon 2ff501590b Tag appropriate files for rc3
Also performed an initial run through of upgrading our Copyright date to
extend to 2005 ... first run here was very simple ... change everything
where: grep 1996-2004 && the word 'Copyright' ... scanned through the
generated list with 'less' first, and after, to make sure that I only
picked up the right entries ...
2004-12-31 22:04:05 +00:00
..
Makefile > Please find enclose a submission to fix these problems. 2004-08-20 20:13:10 +00:00
README.vacuumlo $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
vacuumlo.c Tag appropriate files for rc3 2004-12-31 22:04:05 +00:00

README.vacuumlo

$PostgreSQL: pgsql/contrib/vacuumlo/README.vacuumlo,v 1.4 2003/11/29 19:51:36 pgsql Exp $

This is a simple utility that will remove any orphaned large objects out of a
PostgreSQL database.  An orphaned LO is considered to be any LO whose OID
does not appear in any OID data column of the database.


Compiling
--------

Simply run make. A single executable "vacuumlo" is created.


Usage
-----

vacuumlo [options] database [database2 ... databasen]

All databases named on the command line are processed.  Available options
include:

  -v            Write a lot of progress messages
  -n            Don't remove large objects, just show what would be done
  -U username   Username to connect as
  -W            Prompt for password
  -h hostname   Database server host
  -p port       Database server port


Method
------

First, it builds a temporary table which contains all of the OIDs of the
large objects in that database.

It then scans through all columns in the database that are of type "oid"
or "lo", and removes matching entries from the temporary table.

The remaining entries in the temp table identify orphaned LOs.  These are
removed.


Notes
-----

I decided to place this in contrib as it needs further testing, but hopefully,
this (or a variant of it) would make it into the backend as a "vacuum lo"
command in a later release.

Peter Mount <peter@retep.org.uk>
http://www.retep.org.uk
March 21 1999

Committed April 10 1999 Peter