<listitem><para>user name to connect as.</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
To display specific tables, select which tables to show by
using <option>-o</option>, <option>-f</option> and/or <option>-t</option>.
<option>-o</option> takes an OID,
<option>-f</option> takes a filenode,
and <option>-t</option> takes a table name (actually, it's a <literal>LIKE</literal>
pattern, so you can use things like <literal>foo%</literal>).
You can use as many
of these options as you like, and the listing will include all objects
matched by any of the options. But note that these options can only
show objects in the database given by <option>-d</option>.
</para>
<para>
If you don't give any of <option>-o</option>, <option>-f</option> or <option>-t</option>,
but do give <option>-d</option>, it will list all tables in the database
named by <option>-d</option>. In this mode, the <option>-S</option> and
<option>-i</option> options control what gets listed.
</para>
<para>
If you don't give <option>-d</option> either, it will show a listing of database
OIDs. Alternatively you can give <option>-s</option> to get a tablespace
listing.
</para>
</refsect1>
<refsect1>
<title>Environment</title>
<variablelist>
<varlistentry>
<term><envar>PGHOST</envar></term>
<term><envar>PGPORT</envar></term>
<term><envar>PGUSER</envar></term>
<listitem>
<para>
Default connection parameters.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
This utility, like most other <productname>PostgreSQL</productname>
utilities, also uses the environment variables supported by
<application>libpq</application> (see <xref linkend="libpq-envars"/>).
</para>
<para>
The environment variable <envar>PG_COLOR</envar> specifies whether to use
color in diagnostic messages. Possible values are
<literal>always</literal>, <literal>auto</literal> and
<literal>never</literal>.
</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<application>oid2name</application> requires a running database server with
non-corrupt system catalogs. It is therefore of only limited use
for recovering from catastrophic database corruption situations.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<screen>
$ # what's in this database server, anyway?
$ oid2name
All databases:
Oid Database Name Tablespace
----------------------------------
17228 alvherre pg_default
17255 regression pg_default
17227 template0 pg_default
1 template1 pg_default
$ oid2name -s
All tablespaces:
Oid Tablespace Name
-------------------------
1663 pg_default
1664 pg_global
155151 fastdisk
155152 bigdisk
$ # OK, let's look into database alvherre
$ cd $PGDATA/base/17228
$ # get top 10 db objects in the default tablespace, ordered by size
$ ls -lS * | head -10
-rw------- 1 alvherre