aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/describe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/describe.c')
-rw-r--r--src/bin/psql/describe.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 37b43fb1221..bbe632cc792 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -6232,7 +6232,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, false};
+ static const bool translate_columns[] = {false, false, false, false, false, false, false, false, false};
if (pset.sversion < 100000)
{
@@ -6263,6 +6263,10 @@ listPublications(const char *pattern)
appendPQExpBuffer(&buf,
",\n pubtruncate AS \"%s\"",
gettext_noop("Truncates"));
+ if (pset.sversion >= 180000)
+ appendPQExpBuffer(&buf,
+ ",\n pubgencols AS \"%s\"",
+ gettext_noop("Generated columns"));
if (pset.sversion >= 130000)
appendPQExpBuffer(&buf,
",\n pubviaroot AS \"%s\"",
@@ -6355,6 +6359,7 @@ describePublications(const char *pattern)
int i;
PGresult *res;
bool has_pubtruncate;
+ bool has_pubgencols;
bool has_pubviaroot;
PQExpBufferData title;
@@ -6371,6 +6376,7 @@ describePublications(const char *pattern)
}
has_pubtruncate = (pset.sversion >= 110000);
+ has_pubgencols = (pset.sversion >= 180000);
has_pubviaroot = (pset.sversion >= 130000);
initPQExpBuffer(&buf);
@@ -6382,9 +6388,13 @@ describePublications(const char *pattern)
if (has_pubtruncate)
appendPQExpBufferStr(&buf,
", pubtruncate");
+ if (has_pubgencols)
+ appendPQExpBufferStr(&buf,
+ ", pubgencols");
if (has_pubviaroot)
appendPQExpBufferStr(&buf,
", pubviaroot");
+
appendPQExpBufferStr(&buf,
"\nFROM pg_catalog.pg_publication\n");
@@ -6434,6 +6444,8 @@ describePublications(const char *pattern)
if (has_pubtruncate)
ncols++;
+ if (has_pubgencols)
+ ncols++;
if (has_pubviaroot)
ncols++;
@@ -6448,6 +6460,8 @@ describePublications(const char *pattern)
printTableAddHeader(&cont, gettext_noop("Deletes"), true, align);
if (has_pubtruncate)
printTableAddHeader(&cont, gettext_noop("Truncates"), true, align);
+ if (has_pubgencols)
+ printTableAddHeader(&cont, gettext_noop("Generated columns"), true, align);
if (has_pubviaroot)
printTableAddHeader(&cont, gettext_noop("Via root"), true, align);
@@ -6458,8 +6472,10 @@ 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)
+ if (has_pubgencols)
printTableAddCell(&cont, PQgetvalue(res, i, 8), false, false);
+ if (has_pubviaroot)
+ printTableAddCell(&cont, PQgetvalue(res, i, 9), false, false);
if (!puballtables)
{