Psql patch to show access methods info

From: Sergey Cherkashin <s(dot)cherkashin(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Cc: n(dot)gluhov(at)postgrespro(dot)ru
Subject: Psql patch to show access methods info
Date: 2018-06-22 13:48:44
Message-ID: 1529675324.14193.5.camel@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hello!

There are command in psql to list access methods, but there are no fast
way to look detailed info about them. So here a patch with new
commands:

\dAp     [PATTERN]           list access methods with properties (Table
pg_am)
\dAf[+]  [AMPTRN [OPFPTRN]]  list operator families of access method. +
prints owner of operator family. (Table pg_opfamily) 
\dAfp    [AMPTRN [OPFPTRN]]  list procedures of operator family related
to access method (Table pg_amproc)
\dAfo    [AMPTRN [OPFPTRN]]  list operators of family related to access
method (Table pg_amop)
\dAoc[+] [AMPTRN [OPCPTRN]]  list operator classes of index access
methods. + prints owner of operator class. (Table pg_opclass)
\dip[S]  [PATTERN]           list indexes with properties (Table
pg_class)
\dicp[S] [IDXNAME [COLNAME]] show index column properties (Table
pg_class)

You can display information only on the access methods, specified by a
template. You can also filter operator classes, operator families, or
the name of the indexed column.

I also have a question about testing commands \dAf+ and \dAoc+: is it
good idea to test them by changing an owner of one operator family or
class to created new one, checking the output, and restoring the owner
back? Or we should create a new opclass or opfamily with proper owner.
Or maybe it is not necesary to test these commands?

Best regards,
Sergey Cherkashin
s(dot)cherkashin(at)postgrespro(dot)ru

Attachment Content-Type Size
psql_add_am_info.patch text/x-patch 40.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-06-22 13:51:30 Re: Fix some error handling for read() and errno
Previous Message Robert Haas 2018-06-22 13:33:04 Re: PSA: --enable-coverage interferes with parallel query scheduling