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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Srinath Reddy <srinath2133(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql
Date: 2025-04-15 16:42:00
Message-ID: 1700166.1744735320@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Sabino Mullane <htamfids(at)gmail(dot)com> writes:
> On Tue, Apr 15, 2025 at 4:57 AM Srinath Reddy <srinath2133(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Osipov 2025-04-15 17:27:34 Re: Built-in Raft replication
Previous Message Dimitrios Apostolou 2025-04-15 16:35:48 Re: Fundamental scheduling bug in parallel restore of partitioned tables