diff options
Diffstat (limited to 'src/bin/psql/describe.c')
-rw-r--r-- | src/bin/psql/describe.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 109245fea78..f05e914b4de 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -5707,7 +5707,7 @@ listPublications(const char *pattern) PQExpBufferData buf; PGresult *res; printQueryOpt myopt = pset.popt; - static const bool translate_columns[] = {false, false, false, false, false, false, false}; + static const bool translate_columns[] = {false, false, false, false, false, false, false, false}; if (pset.sversion < 100000) { @@ -5738,6 +5738,10 @@ listPublications(const char *pattern) appendPQExpBuffer(&buf, ",\n pubtruncate AS \"%s\"", gettext_noop("Truncates")); + if (pset.sversion >= 130000) + appendPQExpBuffer(&buf, + ",\n pubviaroot AS \"%s\"", + gettext_noop("Via root")); appendPQExpBufferStr(&buf, "\nFROM pg_catalog.pg_publication\n"); @@ -5779,6 +5783,7 @@ describePublications(const char *pattern) int i; PGresult *res; bool has_pubtruncate; + bool has_pubviaroot; if (pset.sversion < 100000) { @@ -5791,6 +5796,7 @@ describePublications(const char *pattern) } has_pubtruncate = (pset.sversion >= 110000); + has_pubviaroot = (pset.sversion >= 130000); initPQExpBuffer(&buf); @@ -5801,6 +5807,9 @@ describePublications(const char *pattern) if (has_pubtruncate) appendPQExpBufferStr(&buf, ", pubtruncate"); + if (has_pubviaroot) + appendPQExpBufferStr(&buf, + ", pubviaroot"); appendPQExpBufferStr(&buf, "\nFROM pg_catalog.pg_publication\n"); @@ -5850,6 +5859,8 @@ describePublications(const char *pattern) if (has_pubtruncate) ncols++; + if (has_pubviaroot) + ncols++; initPQExpBuffer(&title); printfPQExpBuffer(&title, _("Publication %s"), pubname); @@ -5862,6 +5873,8 @@ describePublications(const char *pattern) printTableAddHeader(&cont, gettext_noop("Deletes"), true, align); if (has_pubtruncate) printTableAddHeader(&cont, gettext_noop("Truncates"), true, align); + if (has_pubviaroot) + printTableAddHeader(&cont, gettext_noop("Via root"), true, align); printTableAddCell(&cont, PQgetvalue(res, i, 2), false, false); printTableAddCell(&cont, PQgetvalue(res, i, 3), false, false); @@ -5870,6 +5883,8 @@ describePublications(const char *pattern) printTableAddCell(&cont, PQgetvalue(res, i, 6), false, false); if (has_pubtruncate) printTableAddCell(&cont, PQgetvalue(res, i, 7), false, false); + if (has_pubviaroot) + printTableAddCell(&cont, PQgetvalue(res, i, 8), false, false); if (!puballtables) { |