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 1hIbBu-0006gG-KF for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 15:49:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIbBt-0005RY-9y for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 15:49:09 +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 1hIbBs-0005RR-PV for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 15:49:09 +0000 Received: from mail-it1-x129.google.com ([2607:f8b0:4864:20::129]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIbBp-0001m6-RP for pgsql-hackers@postgresql.org; Mon, 22 Apr 2019 15:49:07 +0000 Received: by mail-it1-x129.google.com with SMTP id q19so756176itk.3 for ; Mon, 22 Apr 2019 08:49:05 -0700 (PDT) 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=Kt2XZpEjJifFWfLEMdtQwBzb37OXToncJPfMUcfSkf8=; b=fXWzHzrubnEJjPkGi5Y9e6acGwjXl/gtItFoGUepgWp1kNrYzRDCaNcDktb52M7akW LzyfHLZVjZuRJBLFf74uXChzhRHrvbID/JN3fGibhWbeDICoYtxzA+X3CUEMwY7K2UbB 7L0U8xhv2KM/gbVPibU1rjcHZsTfYR/bCb4djjVgQcQaxPisUS8+YxClpNn60EFYbIWF 9npvWQ+t6LxUpfhM3FLRAQT1be5PMU+jBN6GiUC4hRAqd+Shj4tc/w/kj89MmswUIDQ8 LMMuJiUznqzXZ7Kstd6p3wMaNMhrgMI7DsN4qAl++KNWeeB3N78kQelnCi85xDtK6qQH yZ2w== 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=Kt2XZpEjJifFWfLEMdtQwBzb37OXToncJPfMUcfSkf8=; b=hTQ5DUAZ+Dp1J39616Bo4vVLfTyrKlBd+hxoNy/ch6xlL45yUbPoBdS92ZsQNcjqqS xRNO21TT+bU3dto77h0RRp4C9YAqIpGAp3P6zEY7NEp5yxSUI6b1mVnDqu49/NjUWm2v zzZQ3+kWMnvaqd++gsnv+l8C2uh6wOzDhYFJCDOUC6INL0cF5j6b8VwXNBtzhWqOFGTO i5Qom0rMw7ziLhUB5YAOS2hvBuWSOI5YVTcJrKZBbhL+2z2CkVSOxamVqmtw0hVoRqqV w0luRlyHVob/5nuWXgtcdXd8JT5IjcUdCcrOfswmJPOjdoEdQ/89x9aYWZNcYegfyN4A l2Mw== X-Gm-Message-State: APjAAAVMnrghjiKP8RT4o5nguziBKNaVqYH5aZE42cDoEgvW0orDtXzc sx712elApogsyz9Mqs4MrEYbNiZE4AY= X-Google-Smtp-Source: APXvYqwznBBJyppmqrYTb25w6XINrvA0vixv/G51qyKqRGZo+4tcbgdpqbO2MSwV43PCjMItyF81mw== X-Received: by 2002:a24:ee83:: with SMTP id b125mr15711109iti.43.1555948144156; Mon, 22 Apr 2019 08:49:04 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a23sm4645105ios.20.2019.04.22.08.49.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 08:49:03 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 80C018007D7; Mon, 22 Apr 2019 10:49:02 -0500 (CDT) Date: Mon, 22 Apr 2019 10:49:02 -0500 From: Justin Pryzby To: pgsql-hackers@postgresql.org Subject: make \d pg_toast.foo show its indices Message-ID: <20190422154902.GH14223@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1E1Oui4vdubnXi3o" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --1E1Oui4vdubnXi3o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline It's deliberate that \dt doesn't show toast tables. \d shows them, but doesn't show their indices. It seems to me that their indices should be shown, without having to think and know to query pg_index. postgres=# \d pg_toast.pg_toast_2600 TOAST table "pg_toast.pg_toast_2600" Column | Type ------------+--------- chunk_id | oid chunk_seq | integer chunk_data | bytea Indexes: "pg_toast_2600_index" PRIMARY KEY, btree (chunk_id, chunk_seq) Justin --1E1Oui4vdubnXi3o Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="slash-d-show-indices-on-toast.patch" diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index d7390d5..d26d986 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -2274,6 +2274,7 @@ describeOneTableDetails(const char *schemaname, else if (tableinfo.relkind == RELKIND_RELATION || tableinfo.relkind == RELKIND_MATVIEW || tableinfo.relkind == RELKIND_FOREIGN_TABLE || + tableinfo.relkind == RELKIND_TOASTVALUE || tableinfo.relkind == RELKIND_PARTITIONED_TABLE) { /* Footer information about a table */ --1E1Oui4vdubnXi3o--