reshke@yezzey-cbdb-bench:~/cpg/src/bin/psql$ git diff describe.c diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index d6d2a594086..7840e59e40e 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -1761,7 +1761,8 @@ describeOneTableDetails(const char *schemaname, { PGresult *result = NULL; printQueryOpt myopt = pset.popt; - char *footers[2] = {NULL, NULL}; + char *footers[3] = {NULL, NULL, NULL}; + int footer_cnt = 0; if (pset.sversion >= 100000) { @@ -1846,11 +1847,11 @@ describeOneTableDetails(const char *schemaname, switch (PQgetvalue(result, 0, 1)[0]) { case 'a': - footers[0] = psprintf(_("Owned by: %s"), + footers[footer_cnt++] = psprintf(_("Owned by: %s"), PQgetvalue(result, 0, 0)); break; case 'i': - footers[0] = psprintf(_("Sequence for identity column: %s"), + footers[footer_cnt++] = psprintf(_("Sequence for identity column: %s"), PQgetvalue(result, 0, 0)); break; } @@ -1864,6 +1865,10 @@ describeOneTableDetails(const char *schemaname, printfPQExpBuffer(&title, _("Sequence \"%s.%s\""), schemaname, relationname); + /* Access method info */ + if (verbose && tableinfo.relam != NULL && !pset.hide_tableam) + footers[footer_cnt++] = psprintf(_("Access method: %s"), tableinfo.relam); + myopt.footers = footers; myopt.topt.default_footer = false; myopt.title = title.data; @@ -1872,6 +1877,7 @@ describeOneTableDetails(const char *schemaname, printQuery(res, &myopt, pset.queryFout, false, pset.logfile); free(footers[0]); + free(footers[1]); retval = true; goto error_return; /* not an error, just return early */