Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjmRq-0005Zy-7O for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Nov 2020 16:54:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kjmRo-0000n6-G9 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Nov 2020 16:54:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjmRo-0000mz-3p for pgsql-hackers@lists.postgresql.org; Mon, 30 Nov 2020 16:54:44 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kjmRl-0004mZ-MM for pgsql-hackers@postgresql.org; Mon, 30 Nov 2020 16:54:43 +0000 Received: by mail-il1-x135.google.com with SMTP id z14so11940070ilm.10 for ; Mon, 30 Nov 2020 08:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=sG86fpG9Y9WxyyCJroUzWXCyKF2ezMFVasdPeBcTQrE=; b=12FTr7OE9KMz8KLaBA+mPb5/83mJB12Fk49sNeb4gOYttlYKF2+vTshclRjD6z1UVI pcjCI+fc3f92e6JoEnqKL+FSZ5g7eE+oPNwhbNooknDmnM8GoavEx58eYBGqV4Plo2zq rFPNKpkp/etrA7xRXTdibB3ekCT6rYinW3aj2J9qWIludIuulfOYbj5wAkJYHbsywWpW TgvQuzcbFU1GoOsmZP5Ed5C0FQGPPgUCaJ/TEDaM44QB8cXWGFwQ/BIdpsW/TNuGt6kJ fKLfA/7WuX5/qrU6a9YLLpoLY3USryAzU0rh7es5FABY5VtEJvzx+NC6pdj0DaYwEwyc 99Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=sG86fpG9Y9WxyyCJroUzWXCyKF2ezMFVasdPeBcTQrE=; b=buy777yDrUXme4p4fjiLs/fWJXETOQAcbPv1ADeRk+qU6hMQj4ttaZekjld937hTQ1 Ns1ndCuM9D4URKV1Y6AY6rwEnoRL+fzB+qpdU81rbEjKGR+mmRBrisNWNKj0+jbxH/AP ML0WhNfnSn78GOPdBhXsSdVIdTBlrOvLmfcqECL/nsrgGUXukwjtEz8Q+ytRrlEpDu6q dJlyvB321eIauUyTb1ctMZyds24ALfUQ71R5ry85PhdvDlOPmwlDq2WhFNuc/2eRnoC5 p6GiwsJ/DqIz3qYsLLGMgEvKmIwKKw8S6fpVD33sQRwYyDm2a7ZDXbFzMaoeO1xw3L1P IqiQ== X-Gm-Message-State: AOAM530pLFDVHhOcxmBoy75xHDBITHKTUYOAYsn/55BYQUKOeh5SL2aW WPx1YwVD/y1X0WBQwHkAUySVx/S/COZZAU/u X-Google-Smtp-Source: ABdhPJxJgzk9fHhXSjNCt+htmPLFrhNOAWb3A9ex2rqBButmXzT76hOFAue+Gd3vREzTX+zIP3Uk+g== X-Received: by 2002:a05:6e02:e01:: with SMTP id a1mr19964733ilk.101.1606755279592; Mon, 30 Nov 2020 08:54:39 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id u16sm10988863ilj.6.2020.11.30.08.54.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2020 08:54:38 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 1D5B8800CE0; Mon, 30 Nov 2020 10:54:37 -0600 (CST) Date: Mon, 30 Nov 2020 10:54:36 -0600 From: Justin Pryzby To: pgsql-hackers@postgresql.org Subject: allow to \dtS+ pg_toast.* Message-ID: <20201130165436.GX24052@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="K9fy5ol1Oes4Q/ix" 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 --K9fy5ol1Oes4Q/ix Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This makes toast tables a bit less special and easier to inspect. postgres=# \dtS+ pg_toast.pg_toast_2619 pg_toast | pg_toast_2619 | toast table | pryzbyj | permanent | heap | 56 kB | This follows commit from last year: | eb5472da9 make \d pg_toast.foo show its indices ; and, \d toast show its main table -- Justin --K9fy5ol1Oes4Q/ix Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-Allow-to-dt-pg_toast.patch" From 99317e354e0a2744d7f72930773ab4cf78733f26 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Wed, 28 Oct 2020 23:51:39 -0500 Subject: [PATCH v1] Allow to \dt+ pg_toast.* --- src/bin/psql/describe.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index e9c10ced62..e00361a84b 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3758,6 +3758,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys " WHEN " CppAsString2(RELKIND_INDEX) " THEN '%s'" " WHEN " CppAsString2(RELKIND_SEQUENCE) " THEN '%s'" " WHEN 's' THEN '%s'" + " WHEN " CppAsString2(RELKIND_TOASTVALUE) " THEN '%s'" " WHEN " CppAsString2(RELKIND_FOREIGN_TABLE) " THEN '%s'" " WHEN " CppAsString2(RELKIND_PARTITIONED_TABLE) " THEN '%s'" " WHEN " CppAsString2(RELKIND_PARTITIONED_INDEX) " THEN '%s'" @@ -3771,6 +3772,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys gettext_noop("index"), gettext_noop("sequence"), gettext_noop("special"), + gettext_noop("toast table"), gettext_noop("foreign table"), gettext_noop("partitioned table"), gettext_noop("partitioned index"), @@ -3866,6 +3868,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys appendPQExpBufferStr(&buf, CppAsString2(RELKIND_SEQUENCE) ","); if (showSystem || pattern) appendPQExpBufferStr(&buf, "'s',"); /* was RELKIND_SPECIAL */ + if ((showSystem || pattern) && showTables) + appendPQExpBufferStr(&buf, "'t',"); /* toast tables */ if (showForeign) appendPQExpBufferStr(&buf, CppAsString2(RELKIND_FOREIGN_TABLE) ","); @@ -3876,14 +3880,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys appendPQExpBufferStr(&buf, " AND n.nspname <> 'pg_catalog'\n" " AND n.nspname <> 'information_schema'\n"); - /* - * TOAST objects are suppressed unconditionally. Since we don't provide - * any way to select RELKIND_TOASTVALUE above, we would never show toast - * tables in any case; it seems a bit confusing to allow their indexes to - * be shown. Use plain \d if you really need to look at a TOAST - * table/index. - */ - appendPQExpBufferStr(&buf, " AND n.nspname !~ '^pg_toast'\n"); + if (!showSystem) + appendPQExpBufferStr(&buf, " AND n.nspname !~ '^pg_toast'\n"); processSQLNamePattern(pset.db, &buf, pattern, true, false, "n.nspname", "c.relname", NULL, -- 2.17.0 --K9fy5ol1Oes4Q/ix--