Re: psql \dh: List High-Level (Root) Tables and Indexes

From: Sadeq Dousti <msdousti(at)gmail(dot)com>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: psql \dh: List High-Level (Root) Tables and Indexes
Date: 2025-03-27 23:13:07
Message-ID: CADE6LvggyTuA7827W3uE4Oddehsws8kkkLUqRaCv-RdH=FjfLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I think this is the wrong way round.
> It should be \dtN instead of \dNt.

Hi Christoph,
The order does not matter, the user can use \dNt or \dtN, as they do
exactly the same thing. Letters coming after \d can be freely permuted. If
you mean a change to the documentation or tests, I can apply whatever order
makes more sense, as I don't have any particular preference.

> Is the form \dN actually useful?
It's a shortcut for \dtiN. Similarly, \d is a shortcut for \dtvmsE. I'd
like to keep a default because otherwise, we should err if the user types
\dN without further qualifying it, and combining N with other letters (s,
m, E, v, ...) while not including t & i would also result in error.

> For partitioned tables, you'd only get the empty root indexes.
Your statement is correct, but bear with me to give the full version.
With \dN, you get all the tables and indexes that are not partitions.
* root tables
* non-partitioned tables
* indexes on root tables
* indexes on non-partitioned tables
For me, this is the top-level table and index structure in a database. It
can be further restricted by adding t (\dNt or \dtN) to limit it to tables,
and adding i (\dNi or \diN) to limit it to indexes.

Of course, other combinations like \dNvs are also supported.

Best regards,
Sadeq

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2025-03-27 23:18:19 Re: POC, WIP: OR-clause support for indexes
Previous Message Aidar Imamov 2025-03-27 22:53:29 Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions