Re: Psql patch to show access methods info - Mailing list pgsql-hackers

From Nikita Glukhov
Subject Re: Psql patch to show access methods info
Date
Msg-id 13e8c19b-d487-747f-c8e8-6e7bd584600e@postgrespro.ru
Whole thread Raw
In response to Re: Psql patch to show access methods info  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: Psql patch to show access methods info
List pgsql-hackers
Attached 8th version of the patches.


On 22.07.2019 15:58, Alexander Korotkov wrote:
> On Mon, Jul 22, 2019 at 6:29 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>> On 2019-Jul-21, Alexander Korotkov wrote:
>>> I've one note.  Behavior of "\dA" and "\dA pattern" look
>>> counter-intuitive to me.  I would rather expect that "\dA pattern"
>>> would just filter results of "\dA", but it displays different
>>> information.  I suggest rename displaying access method properties
>>> from "\dA pattern" to different.
>> \dA+ maybe?  Then ...
>>
>>> And leave "\dA pattern" just filter results of "\dA".
>> "\dA+ pattern" works intuitively, I think.
> Sounds good for me.
>
> We already have some functionality for \dA+.
>
> # \dA+
>                               List of access methods
>    Name  | Type  |       Handler        |              Description
> --------+-------+----------------------+----------------------------------------
>   brin   | index | brinhandler          | block range index (BRIN) access method
>   btree  | index | bthandler            | b-tree index access method
>   gin    | index | ginhandler           | GIN index access method
>   gist   | index | gisthandler          | GiST index access method
>   hash   | index | hashhandler          | hash index access method
>   heap   | table | heap_tableam_handler | heap table access method
>   spgist | index | spghandler           | SP-GiST index access method
> (7 rows)
>
> What we need is that new \dA+ functionality cover existing one.  That
> it, we should add Handler and Description column to the output.
>
> # \dA+ *
>                                       Index access method properties
>     AM   | Ordering | Unique indexes | Multicol indexes | Exclusion
> constraints | Include non-key columns
> --------+----------+----------------+------------------+-----------------------+-------------------------
>   brin   | no       | no             | yes              | no
>          | no
>   btree  | yes      | yes            | yes              | yes
>          | yes
>   gin    | no       | no             | yes              | no
>          | no
>   gist   | no       | no             | yes              | yes
>          | yes
>   hash   | no       | no             | no               | yes
>          | no
>   spgist | no       | no             | no               | yes
>          | no
> (6 rows)
>
>                   Table access method properties
>   Name | Type  |       Handler        |       Description
> ------+-------+----------------------+--------------------------
>   heap | table | heap_tableam_handler | heap table access method
> (1 row)

Columns "Handler" and "Description" were added to \dA+.

\dA [NAME] now shows only amname and amtype.


Also added support for pre-9.6 server versions to both \dA and \dA+.

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: errbacktrace
Next
From: Manuel Rigger
Date:
Subject: Re: Broken defenses against dropping a partitioning column