Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIjjs-0006FO-Ln for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Apr 2019 00:56:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIjjr-00080e-Dq for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Apr 2019 00:56:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIjjq-0007tJ-Vi for pgsql-hackers@lists.postgresql.org; Tue, 23 Apr 2019 00:56:47 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIjjo-0006Id-9W for pgsql-hackers@postgresql.org; Tue, 23 Apr 2019 00:56:45 +0000 Received: by fetter.org (Postfix, from userid 1001) id 9FD3140828; Tue, 23 Apr 2019 02:56:42 +0200 (CEST) Date: Tue, 23 Apr 2019 02:56:42 +0200 From: David Fetter To: PostgreSQL Development Subject: [PATCH v1] Show whether tables are logged in \dt+ Message-ID: <20190423005642.GZ28936@fetter.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="DIOMP1UsTsWJauNi" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --DIOMP1UsTsWJauNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Folks, I noticed that there wasn't a bulk way to see table logged-ness in psql, so I made it part of \dt+. What say? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate --DIOMP1UsTsWJauNi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-Show-whether-tables-are-logged-in-dt.patch" From 518efc003730c441663aae42c18d16f0908bd55d Mon Sep 17 00:00:00 2001 From: David Fetter Date: Mon, 22 Apr 2019 17:50:48 -0700 Subject: [PATCH v1] Show whether tables are logged in \dt+ To: hackers MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.20.1" This is a multi-part message in MIME format. --------------2.20.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit \d would show this for individual tables, but there wasn't an overarching view of all tables. Now, there is. diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index ee00c5da08..5ef567c123 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3631,7 +3631,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys PQExpBufferData buf; PGresult *res; printQueryOpt myopt = pset.popt; - static const bool translate_columns[] = {false, false, true, false, false, false, false}; + static const bool translate_columns[] = {false, false, true, false, false, false, false, false}; /* If tabtypes is empty, we default to \dtvmsE (but see also command.c) */ if (!(showTables || showIndexes || showViews || showMatViews || showSeq || showForeign)) @@ -3695,6 +3695,11 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys appendPQExpBuffer(&buf, ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"", gettext_noop("Description")); + + if (pset.sversion >= 91000) + appendPQExpBuffer(&buf, + ",\n c.relpersistence <> 'u' as \"%s\"", + gettext_noop("Logged")); } appendPQExpBufferStr(&buf, --------------2.20.1-- --DIOMP1UsTsWJauNi--