diff options
| author | Tom Lane | 2017-07-28 21:44:48 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-07-28 21:44:48 +0000 |
| commit | 9dea962b3ef48f6e96172653b7cf80cb5f53e6b6 (patch) | |
| tree | 9cbf5bed612739ec41101afe721dfebafb2d1b77 /src/bin/psql | |
| parent | 3c163a7fc76debbbdad1bdd3c43721cffe72f4db (diff) | |
Include publication owner's name in the output of \dRp+.
Without this, \dRp prints information that \dRp+ does not, which
seems pretty odd.
Daniel Gustafsson
Discussion: https://postgr.es/m/3641F19B-336A-431A-86CE-A80562505C5E@yesql.se
Diffstat (limited to 'src/bin/psql')
| -rw-r--r-- | src/bin/psql/describe.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 78e9d895f0..798e71045f 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -5162,8 +5162,9 @@ describePublications(const char *pattern) initPQExpBuffer(&buf); printfPQExpBuffer(&buf, - "SELECT oid, pubname, puballtables, pubinsert,\n" - " pubupdate, pubdelete\n" + "SELECT oid, pubname,\n" + " pg_catalog.pg_get_userbyid(pubowner) AS owner,\n" + " puballtables, pubinsert, pubupdate, pubdelete\n" "FROM pg_catalog.pg_publication\n"); processSQLNamePattern(pset.db, &buf, pattern, false, false, @@ -5198,13 +5199,13 @@ describePublications(const char *pattern) for (i = 0; i < PQntuples(res); i++) { const char align = 'l'; - int ncols = 4; + int ncols = 5; int nrows = 1; int tables = 0; PGresult *tabres; char *pubid = PQgetvalue(res, i, 0); char *pubname = PQgetvalue(res, i, 1); - bool puballtables = strcmp(PQgetvalue(res, i, 2), "t") == 0; + bool puballtables = strcmp(PQgetvalue(res, i, 3), "t") == 0; int j; PQExpBufferData title; printTableOpt myopt = pset.popt.topt; @@ -5214,6 +5215,7 @@ describePublications(const char *pattern) printfPQExpBuffer(&title, _("Publication %s"), pubname); printTableInit(&cont, &myopt, title.data, ncols, nrows); + printTableAddHeader(&cont, gettext_noop("Owner"), true, align); printTableAddHeader(&cont, gettext_noop("All tables"), true, align); printTableAddHeader(&cont, gettext_noop("Inserts"), true, align); printTableAddHeader(&cont, gettext_noop("Updates"), true, align); @@ -5223,6 +5225,7 @@ describePublications(const char *pattern) printTableAddCell(&cont, PQgetvalue(res, i, 3), false, false); printTableAddCell(&cont, PQgetvalue(res, i, 4), false, false); printTableAddCell(&cont, PQgetvalue(res, i, 5), false, false); + printTableAddCell(&cont, PQgetvalue(res, i, 6), false, false); if (!puballtables) { |
