Re: Psql patch to show access methods info

Alexander Korotkov <a.korotkov@postgrespro.ru>

From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>, Nikita Glukhov <n.gluhov@postgrespro.ru>, Thomas Munro <thomas.munro@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, David Steele <david@pgmasters.net>, Michael Paquier <michael@paquier.xyz>
Date: 2019-09-23T19:54:51Z
Lists: pgsql-hackers

Attachments

On Wed, Sep 18, 2019 at 5:04 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> On 2019-Sep-18, Alexander Korotkov wrote:
>
> > On Tue, Sep 17, 2019 at 9:01 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
> > > I think \dAf is just as critical as \dAo; the former lets you know which
> > > opfamilies you can use in CREATE INDEX, while the latter lets you know
> > > which operators would be helped by such an index.  (But, really, only if
> > > the opfamily name is printed in \d of the index, which we currently
> > > don't print unless it's non-default ... which is an omission that
> > > perhaps we should consider fixing).
>
> > I think you have a point.  Will add \dAf command to the patch.
>
> Great, thanks.

Revised patch is attached.

1) It adds \dAf[+] command showing opfamilies, which belong to given
AM and have opclasses for given datatype.
2) It turns back warning when running \dA[+] with 2 or more arguments.

Two questions are open for me:

1) Currently we allow to filter opfamilies by type, but supported
types aren't displayed.  Should we display datatypes?  Should we
aggregate them into comma-separated list?
2) Given we now can display the list of opfamilies, it would be
reasonable to be able to see list of opclasses belonging to particular
opfamily.  But currently \dAc doesn't have filter by opclass.  Should
we implement this as an separate command?

I'll be very glad for feedback.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Show opclass and opfamily related information in psql