sql_exec_dumpalltables(PGconn *conn, struct options *opts)
{
char todo[1024];
- char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
+ char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\", pg_relation_filepath(c.oid) as \"Path\" ";
snprintf(todo, sizeof(todo),
"SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s "
*comma_filenumbers,
*comma_tables;
bool written = false;
- char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
+ char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\", pg_relation_filepath(c.oid) as \"Path\" ";
/* get tables qualifiers, whether names, filenumbers, or OIDs */
comma_oids = get_comma_elts(opts->oids);
<term><option>-x</option></term>
<term><option>--extended</option></term>
<listitem><para>display more information about each object shown: tablespace name,
- schema name, and OID.
+ schema name, OID and path.
</para></listitem>
</varlistentry>
$ # you can mix the options, and get more details with -x
$ oid2name -d alvherre -t accounts -f 1155291 -x
From database "alvherre":
- Filenode Table Name Oid Schema Tablespace
-------------------------------------------------------
- 155173 accounts 155173 public pg_default
- 1155291 accounts_pkey 1155291 public pg_default
+ Filenode Table Name Oid Schema Tablespace Path
+--------------------------------------------------------------------------
+ 155173 accounts 155173 public pg_default base/17228/155173
+ 1155291 accounts_pkey 1155291 public pg_default base/17228/1155291
$ # show disk space for every db object
$ du [0-9]* |