Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/vacuumlo.sgml`
3dc6c493f0e20ea08ddf99d466c3689dcd060cee5489bc040000000100000de9
<!-- doc/src/sgml/vacuumlo.sgml -->

<refentry id="vacuumlo">
 <indexterm zone="vacuumlo">
  <primary>vacuumlo</primary>
 </indexterm>

 <refmeta>
  <refentrytitle><application>vacuumlo</application></refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo>Application</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>vacuumlo</refname>
  <refpurpose>remove orphaned large objects from a <productname>PostgreSQL</productname> database</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
  <cmdsynopsis>
   <command>vacuumlo</command>
   <arg choice="opt" rep="repeat"><replaceable>option</replaceable></arg>
   <arg choice="plain" rep="repeat"><replaceable>dbname</replaceable></arg>
  </cmdsynopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

 <para>
  <application>vacuumlo</application> is a simple utility program that will remove any
  <quote>orphaned</quote> large objects from a
  <productname>PostgreSQL</productname> database.  An orphaned large object (LO) is
  considered to be any LO whose OID does not appear in any <type>oid</type> or
  <type>lo</type> data column of the database.
 </para>

 <para>
  If you use this, you may also be interested in the <function>lo_manage</function>
  trigger in the <xref linkend="lo"/> module.
  <function>lo_manage</function> is useful to try
  to avoid creating orphaned LOs in the first place.
 </para>

  <para>
   All databases named on the command line are processed.
  </para>
 </refsect1>

 <refsect1>
  <title>Options</title>

  <para>
   <application>vacuumlo</application> accepts the following command-line arguments:

  <variablelist>
   <varlistentry>
    <term><option>-l <replaceable class="parameter">limit</replaceable></option></term>
    <term><option>--limit=<replaceable class="parameter">limit</replaceable></option></term>
    <listitem>
     <para>
      Remove no more than <replaceable>limit</replaceable> large objects per
      transaction (default 1000).  Since the server acquires a lock per LO
      removed, removing too many LOs in one transaction risks exceeding
      <xref linkend="guc-max-locks-per-transaction"/>.  Set the limit to
      zero if you want all removals done in a single transaction.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><option>-n</option></term>
    <term><option>--dry-run</option></term>
    <listitem>
     <para>Don't remove anything, just show what would be done.</para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><option>-v</option></term>
    <term><option>--verbose</option></term>
    <listitem>
     <para>Write a lot of progress messages.</para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><option>-V</option></term>
    <term><option>--version</option></term>
    <listitem>
     <para>
      Print the <application>vacuumlo</application> version and exit.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><option>-?</option></term>
    <term><option>--help</option></term>
    <listitem>
     <para>
      Show help about <application>vacuumlo</application> command line
      arguments, and exit.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
  </para>

  <para>
   <application>vacuumlo</application> also accepts the following command-line
   arguments for connection parameters:

  <variablelist>
   <varlistentry>
    <term><option>-h <replaceable class="parameter">host</replaceable></option></term>
    <term><option>--host=<replaceable class="parameter">host</replaceable></option></term>

Title: vacuumlo: PostgreSQL Utility for Removing Orphaned Large Objects
Summary
vacuumlo is a command-line utility for PostgreSQL databases that removes orphaned large objects (LOs). It processes all specified databases, removing LOs whose OIDs don't appear in any oid or lo data columns. The tool offers various options, including limiting the number of LOs removed per transaction, performing a dry run, and verbose output. It also accepts connection parameters for specifying the host, port, username, and password for database access.