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

Greg Sabino Mullane <htamfids@gmail.com>

From: Greg Sabino Mullane <htamfids@gmail.com>
To: Srinath Reddy <srinath2133@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-04-15T14:55:27Z
Lists: pgsql-hackers
On Tue, Apr 15, 2025 at 4:57 AM Srinath Reddy <srinath2133@gmail.com> wrote:

> - Table Access Methods are increasingly used.
>

Citation needed.


> - There's currently no native `\d`-style way to explore which tables are
> using a given TAM.
>

There's also no way to list which tables are unlogged. Or which have
autovacuum disabled. Or which belong to a specific tablespace. All of which
are arguably more commonly requested than a 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.

Downstream, you wrote:

> Not everyone wants to write or remember complex queries


True - but you can write a view or a function to support those cases.


Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support