head	1.6;
access;
symbols
	REL7_4_29:1.3
	REL8_0_25:1.4
	REL8_1_21:1.5
	REL8_2_17:1.5
	REL7_4_28:1.3
	REL8_0_24:1.4
	REL8_1_20:1.5
	REL8_2_16:1.5
	REL7_4_27:1.3
	REL8_0_23:1.4
	REL8_1_19:1.5
	REL8_2_15:1.5
	REL7_4_26:1.3
	REL8_0_22:1.4
	REL8_1_18:1.5
	REL8_2_14:1.5
	REL7_4_25:1.3
	REL8_0_21:1.4
	REL8_1_17:1.5
	REL8_2_13:1.5
	REL7_4_24:1.3
	REL8_0_20:1.4
	REL8_1_16:1.5
	REL8_2_12:1.5
	REL7_4_23:1.3
	REL8_0_19:1.4
	REL8_1_15:1.5
	REL8_2_11:1.5
	REL7_4_22:1.3
	REL8_0_18:1.4
	REL8_1_14:1.5
	REL8_2_10:1.5
	REL7_4_21:1.3
	REL8_0_17:1.4
	REL8_1_13:1.5
	REL8_2_9:1.5
	REL7_4_20:1.3
	REL8_0_16:1.4
	REL8_1_12:1.5
	REL8_2_8:1.5
	REL8_2_7:1.5
	REL7_3_21:1.2
	REL7_4_19:1.3
	REL8_0_15:1.4
	REL8_1_11:1.5
	REL8_2_6:1.5
	REL8_3_BETA2:1.5
	REL8_3_BETA1:1.5
	REL7_3_20:1.2
	REL7_4_18:1.3
	REL8_0_14:1.4
	REL8_1_10:1.5
	REL8_2_5:1.5
	REL7_3_19:1.2
	REL7_4_17:1.3
	REL8_0_13:1.4
	REL8_1_9:1.5
	REL8_2_4:1.5
	REL8_0_12:1.4
	REL8_1_8:1.5
	REL8_2_3:1.5
	REL7_3_18:1.2
	REL7_4_16:1.3
	REL8_0_11:1.4
	REL8_1_7:1.5
	REL8_2_2:1.5
	REL8_0_10:1.4
	REL8_1_6:1.5
	REL8_2_1:1.5
	REL7_4_15:1.3
	REL7_3_17:1.2
	REL8_2_STABLE:1.5.0.4
	REL8_2_0:1.5
	REL8_2_RC1:1.5
	REL8_2_BETA3:1.5
	REL8_2_BETA2:1.5
	REL8_1_5:1.5
	REL8_0_9:1.4
	REL7_4_14:1.3
	REL7_3_16:1.2
	REL8_2_BETA1:1.5
	REL7_3_15:1.2
	REL7_4_13:1.3
	REL8_0_8:1.4
	REL8_1_4:1.5
	REL7_3_14:1.2
	REL7_4_12:1.3
	REL8_0_7:1.4
	REL8_1_3:1.5
	REL7_3_13:1.2
	REL7_4_11:1.3
	REL8_0_6:1.4
	REL8_1_2:1.5
	REL7_3_12:1.2
	REL7_4_10:1.3
	REL8_0_5:1.4
	REL8_1_1:1.5
	REL8_1_STABLE:1.5.0.2
	REL8_1_0:1.5
	REL8_1_0RC1:1.5
	REL8_1_0BETA4:1.5
	REL8_1_0BETA3:1.5
	REL7_3_11:1.2
	REL7_4_9:1.3
	REL8_0_4:1.4
	REL8_1_0BETA2:1.5
	REL8_1_0BETA1:1.5
	REL7_2_8:1.2
	REL7_3_10:1.2
	REL7_4_8:1.3
	REL8_0_3:1.4
	REL8_0_2:1.4
	REL7_2_7:1.2
	REL7_3_9:1.2
	REL7_4_7:1.3
	REL8_0_1:1.4
	REL8_0_STABLE:1.4.0.4
	REL8_0_0:1.4.0.2
	REL8_0_0RC5:1.4
	REL8_0_0RC4:1.4
	REL8_0_0RC3:1.4
	REL8_0_0RC2:1.4
	REL8_0_0RC1:1.4
	REL8_0_0BETA5:1.4
	REL8_0_0BETA4:1.4
	REL7_4_6:1.3
	REL7_3_8:1.2
	REL7_2_6:1.2
	REL8_0_0BETA3:1.4
	REL8_0_0BETA2:1.4
	REL7_2_5:1.2
	REL7_4_5:1.3
	REL7_3_7:1.2
	REL7_4_4:1.3
	REL8_0_0BETA1:1.4
	REL7_4_3:1.3
	REL7_4_2:1.3
	REL7_3_6:1.2
	REL7_4_1:1.3
	REL7_3_5:1.2
	REL7_4:1.3
	REL7_4_RC2:1.3
	REL7_4_STABLE:1.3.0.4
	REL7_4_RC1:1.3
	REL7_4_BETA5:1.3
	REL7_4_BETA4:1.3
	REL7_4_BETA3:1.3
	REL7_4_BETA2:1.3
	WIN32_DEV:1.3.0.2
	REL7_4_BETA1:1.3
	REL7_3_4:1.2
	REL7_3_2:1.2
	REL7_2_4:1.2
	REL7_3_STABLE:1.2.0.6
	REL7_2_3:1.2
	REL7_2_STABLE:1.2.0.4
	REL7_2:1.2
	REL7_2_RC2:1.2
	REL7_2_RC1:1.2
	REL7_2_BETA5:1.2
	REL7_2_BETA4:1.2
	REL7_2_BETA3:1.2
	REL7_2_BETA2:1.2
	REL7_2_BETA1:1.2
	REL7_1_2:1.2
	REL7_1_STABLE:1.2.0.2
	REL7_1_BETA:1.2
	REL7_1_BETA3:1.2
	REL7_1_BETA2:1.2
	REL7_1:1.2;
locks; strict;
comment	@# @;


1.6
date	2007.11.10.23.30.46;	author momjian;	state dead;
branches;
next	1.5;

1.5
date	2005.06.23.00.06.37;	author tgl;	state Exp;
branches;
next	1.4;

1.4
date	2003.11.29.19.51.36;	author pgsql;	state Exp;
branches;
next	1.3;

1.3
date	2003.08.04.22.03.39;	author tgl;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.21.17.54.21;	author tgl;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.19.14.02.16;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Move most /contrib README files into SGML.  Some still need conversion
or will never be converted.
@
text
@$PostgreSQL: pgsql/contrib/vacuumlo/README.vacuumlo,v 1.5 2005/06/23 00:06:37 tgl 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.

If you use this, you may also be interested in the lo_manage trigger in
contrib/lo.  lo_manage is useful to try to avoid creating orphaned LOs
in the first place.


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
@


1.5
log
@Cleanup the contrib/lo module: there is no need anymore to implement
a physically separate type.  Defining 'lo' as a domain over OID works
just fine and is more efficient.  Improve documentation and fix up the
test script.  (Would like to turn test script into a proper regression
test, but right now its output is not constant because of numeric OIDs;
plus it makes Unix-specific assumptions about files it can import.)
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/contrib/vacuumlo/README.vacuumlo,v 1.4 2003/11/29 19:51:36 pgsql Exp $
@


1.4
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d1 1
a1 1
$PostgreSQL: /cvsroot/pgsql-server/contrib/vacuumlo/README.vacuumlo,v 1.3 2003/08/04 22:03:39 tgl Exp $
d7 4
@


1.3
log
@Update vacuumlo to be properly schema-aware.  Improve documentation.
@
text
@d1 1
a1 1
$Header: /cvsroot/pgsql-server/contrib/vacuumlo/README.vacuumlo,v 1.2 2000/11/21 17:54:21 tgl Exp $
@


1.2
log
@Code review and cleanup.
@
text
@d1 1
a1 1
$Header: /home/projects/pgsql/cvsroot/pgsql/contrib/vacuumlo/README.vacuumlo,v 1.1 2000/06/19 14:02:16 momjian Exp $
d17 1
a17 1
vacuumlo [-v] database [db2 ... dbn]
d19 9
a27 1
The -v flag outputs some progress messages to stdout.
d33 1
a33 1
First, it builds a temporary table which contains all of the oid's of the
d36 2
a37 2
It then scans through all columns in the database that are of type 'oid',
and removes any matching entries from the temporary table.
@


1.1
log
@Add missing /contrib files
@
text
@d1 1
a1 1
$Header: /home/projects/pgsql/cvsroot/pgsql/contrib/vacuumlo/README,v 1.1 1999/04/10 16:48:04 peter Exp $
d4 3
a6 1
PostgreSQL database.
d13 3
a15 2
Useage
------
d21 1
d28 6
a33 2
It then scans through any columns in the database that are of type 'oid', and
removes any entries from the temporary table.
d35 2
a36 2
Finally, it runs through the first table, and removes from the second table, any
oid's it finds. What is left are the orphans, and these are removed.
d39 2
a40 2
this (or a variant of it) would make it into the backed as a "vacuum lo" command
in a later release.
@
