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>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql \dh: List High-Level (Root) Tables and Indexes
Date: 2025-03-28 11:55:22
Message-ID: CADE6LvgPo+r6qpSuVeOJpdHptYhwwb6_q0TwZuKOMrKx7HH0Rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The S flag is "universal" enough and can be combined with a wide variety of
commands to show system views. Examples include \d, \dn, \dp, \dL, and so
on. In contrast, the N I'm introducing can only be combined with \d, so I
wouldn't treat it the same as S.

All things that combine with \d (t, i, m, s, etc.) are used to show an
object type. In that sense, they are also flags, but the generic nature of
S and x flags made them stand out in the documentation.

Best regards,
Sadeq

On Fri, Mar 28, 2025, 11:27 Christoph Berg <myon(at)debian(dot)org> wrote:

> Re: Sadeq Dousti
> > > 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.
>
> Oh ok, that's perfect then.
>
> HELP0(" \\dn[Sx+] [PATTERN] list schemas\n");
> + HELP0(" \\dN[Sx+] [PATTERN] list tables and indexes (no
> partitions)\n");
> HELP0(" \\do[Sx+] [OPPTRN [TYPEPTRN [TYPEPTRN]]]\n"
>
> Is this really a new "top-level" \d command and not a flag for the
> existing \d commands? I would think that the help texts should place
> the N next to S which is a similar "show different set of things"
> modifier:
>
> \d[NSx+] list tables, views, and sequences
> \di[NSx+] [PATTERN] list indexes
> \dt[NSx+] [PATTERN] list tables
>
> For documentation and tests, the N should be at the end like S is at
> the end in \dt[S+].
>
> Christoph
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2025-03-28 11:59:30 Re: POC, WIP: OR-clause support for indexes
Previous Message Mahendra Singh Thalor 2025-03-28 11:38:26 Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote