Skip to content

Commit 38bf9d0

Browse files
author
Commitfest Bot
committed
[PATCH]: ./oid2name_filepathv4.patch
1 parent eee19a3 commit 38bf9d0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contrib/oid2name/oid2name.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ void
469469
sql_exec_dumpalltables(PGconn *conn, struct options *opts)
470470
{
471471
char todo[1024];
472-
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
472+
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\", pg_relation_filepath(c.oid) as \"Filepath\" ";
473473

474474
snprintf(todo, sizeof(todo),
475475
"SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s "
@@ -507,7 +507,7 @@ sql_exec_searchtables(PGconn *conn, struct options *opts)
507507
*comma_filenumbers,
508508
*comma_tables;
509509
bool written = false;
510-
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
510+
char *addfields = ",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\", pg_relation_filepath(c.oid) as \"Filepath\" ";
511511

512512
/* get tables qualifiers, whether names, filenumbers, or OIDs */
513513
comma_oids = get_comma_elts(opts->oids);

doc/src/sgml/oid2name.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<term><option>-x</option></term>
119119
<term><option>--extended</option></term>
120120
<listitem><para>display more information about each object shown: tablespace name,
121-
schema name, and OID.
121+
schema name, OID and file path..
122122
</para></listitem>
123123
</varlistentry>
124124

@@ -299,10 +299,10 @@ From database "alvherre":
299299
$ # you can mix the options, and get more details with -x
300300
$ oid2name -d alvherre -t accounts -f 1155291 -x
301301
From database "alvherre":
302-
Filenode Table Name Oid Schema Tablespace
303-
------------------------------------------------------
304-
155173 accounts 155173 public pg_default
305-
1155291 accounts_pkey 1155291 public pg_default
302+
Filenode Table Name Oid Schema Tablespace Filepath
303+
--------------------------------------------------------------------------
304+
155173 accounts 155173 public pg_default base/17228/155173
305+
1155291 accounts_pkey 1155291 public pg_default base/17228/1155291
306306

307307
$ # show disk space for every db object
308308
$ du [0-9]* |

0 commit comments

Comments
 (0)