![]() |
![]()
| ![]() |
![]()
NAMEoid2name - resolve OIDs and file nodes in a PostgreSQL data directory SYNOPSISoid2name [option...] DESCRIPTIONoid2name is a utility program that helps administrators to examine the file structure used by PostgreSQL. To make use of it, you need to be familiar with the database file structure, which is described in Chapter 66. Note The name “oid2name” is historical, and is actually rather misleading, since most of the time when you use it, you will really be concerned with tables' filenode numbers (which are the file names visible in the database directories). Be sure you understand the difference between table OIDs and table filenodes! oid2name connects to a target database and extracts OID, filenode, and/or table name information. You can also have it show database OIDs or tablespace OIDs. OPTIONSoid2name accepts the following command-line arguments: -f filenode
show info for table with filenode filenode.
-i
include indexes and sequences in the listing.
-o oid
show info for table with OID oid.
-q
omit headers (useful for scripting).
-s
show tablespace OIDs.
-S
include system objects (those in
information_schema, pg_toast and pg_catalog
schemas).
-t tablename_pattern
show info for table(s) matching
tablename_pattern.
-V
Print the oid2name version and exit.
-x
display more information about each object shown:
tablespace name, schema name, and OID.
-?
Show help about oid2name command line arguments, and
exit.
oid2name also accepts the following command-line arguments for connection parameters: -d database
database to connect to.
-h host
database server's host.
-H host database server's host. Use of this parameter is
deprecated as of PostgreSQL 12.
-p port
database server's port.
-U username
user name to connect as.
To display specific tables, select which tables to show by using -o, -f and/or -t. -o takes an OID, -f takes a filenode, and -t takes a table name (actually, it's a LIKE pattern, so you can use things like foo%). 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 -d. If you don't give any of -o, -f or -t, but do give -d, it will list all tables in the database named by -d. In this mode, the -S and -i options control what gets listed. If you don't give -d either, it will show a listing of database OIDs. Alternatively you can give -s to get a tablespace listing. ENVIRONMENTPGHOST
Default connection parameters.
This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 32.15). The environment variable PG_COLOR specifies whether to use color in diagnostic messages. Possible values are always, auto and never. NOTESoid2name requires a running database server with non-corrupt system catalogs. It is therefore of only limited use for recovering from catastrophic database corruption situations. EXAMPLES$ # what's in this database server, anyway? $ oid2name All databases: AUTHORB. Palmer <bpalmer@crimelabs.net>
|