pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: David Steele <david@pgmasters.net>
Subject: Re: Psql patch to show access methods info
Date: Tue, 21 Jan 2020 19:33:29 -0300
Message-ID: <20200121223329.GA18317@alvherre.pgsql> (raw)
In-Reply-To: <CAPpHfdtxKTQFXTBrw_qdY8DUpLvQHxX63Euy3b1zR9SFO5J20w@mail.gmail.com>

I think I would like this feature to be in, but I'm not sure that the
shape is final yet.  My points:

a) I don't see any use for \dA as presented; I think the \dA+ output is
   useful.  Therefore my preference would be that \dA presents what the
   latest patch has as \dA+.  I think we should leave \dA+ unimplemented
   for now; maybe we can use some use for it later on.

b) I think \dAp should list the function used for each support proc.  I
   don't have any use for \dAp actually (I already said that upthread,
   sorry for repeating myself), but I think that if we have it, then
   showing only the proc number is pointless.

c) it would be damn handy if \dAf (maybe \dAf+) lists the datatypes that
   each opfamily has opclasses for.  Maybe make the output an array, like
   {int4,int8,numeric,...}  Something like [*] but somehow make it
   prettier?

d) This one I'm unsure about: should we list the opfamily for each
   opclass in \dAc?  I'm not sure whether it's useful for anything.

[*]
SELECT DISTINCT am.amname AS "AM",
  CASE
    WHEN pg_catalog.pg_opfamily_is_visible(f.oid)
    THEN format('%I', f.opfname)
    ELSE format('%I.%I', n.nspname, f.opfname)
  END AS "Operator family",
	string_agg(format_type(c.opcintype, -1), ', ') as "Applicable types",
  pg_catalog.pg_get_userbyid(f.opfowner) AS "Owner"

FROM pg_catalog.pg_opfamily f
  LEFT JOIN pg_catalog.pg_am am on am.oid = f.opfmethod
  LEFT JOIN pg_catalog.pg_namespace n ON n.oid = f.opfnamespace
left join pg_catalog.pg_opclass c on (f.oid = c.opcfamily)
group by 1, 2, 4 ORDER BY 1, 2;

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (56+ messages)  latest in thread

Message-ID: <20200121223329.GA18317@alvherre.pgsql>
Permalink:  ../20200121223329.GA18317@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200121223329.GA18317@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, a.korotkov@postgrespro.ru, michael@paquier.xyz, andres@anarazel.de, n.gluhov@postgrespro.ru, thomas.munro@gmail.com, horiguchi.kyotaro@lab.ntt.co.jp, david@pgmasters.net
  Subject: Re: Psql patch to show access methods info
  In-Reply-To: <20200121223329.GA18317@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox