Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql
Date
Msg-id 1700166.1744735320@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql  (Greg Sabino Mullane <htamfids@gmail.com>)
List pgsql-hackers
Greg Sabino Mullane <htamfids@gmail.com> writes:
> On Tue, Apr 15, 2025 at 4:57 AM Srinath Reddy <srinath2133@gmail.com> wrote:
>> - There's currently no native `\d`-style way to explore which tables are
>> using a given TAM.

> Perhaps there could be a more generic table-filtering mechanism for \d, but
> carving something out for such a niche case seems unwarranted, IMO.

I don't have a strong opinion on whether this functionality is worth
having in a psql meta-command.  But I don't like the proposed syntax
one bit.  In my mind the \dA group of meta-commands are supposed to
provide information on the *properties* of access methods.  Not on
what uses them.  It could be reasonable to have a \dAt command that
shows information about a table access method (although not much is
exposed at SQL level today, so there's not a lot for it to do).
But, for example, \dAf does not run around and find all indexes
using that operator family.

I like your thought that maybe this functionality could be cast
as some sort of filter in the \dt command group (with a syntax that
would allow for other sorts of filters too).  I don't have concrete
ideas about how to write that though.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Dimitrios Apostolou
Date:
Subject: Re: Fundamental scheduling bug in parallel restore of partitioned tables
Next
From: Konstantin Osipov
Date:
Subject: Re: Built-in Raft replication