Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juLea-00049Z-1Z for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 19:59:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juLeY-0002zS-Es for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 19:59:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juLeY-0002zL-7j for pgsql-hackers@lists.postgresql.org; Sat, 11 Jul 2020 19:59:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juLeW-0002aO-8s; Sat, 11 Jul 2020 19:59:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 06BJxCPp2448027; Sat, 11 Jul 2020 15:59:12 -0400 From: Tom Lane To: Alexander Korotkov cc: "Jonathan S. Katz" , Peter Eisentraut , pgsql-hackers Subject: Re: output columns of \dAo and \dAp In-reply-to: References: <2edc7b27-031f-b2b6-0db2-864241c91cb9@2ndquadrant.com> <1698998.1591479248@sss.pgh.pa.us> Comments: In-reply-to Alexander Korotkov message dated "Sat, 11 Jul 2020 14:23:33 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2448025.1594497552.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 11 Jul 2020 15:59:12 -0400 Message-ID: <2448026.1594497552@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Korotkov writes: > The proposed patch is attached. This patch is fixes two points: > * Adds strategy number and purpose to output of \dAo > * Renames "Left/right arg type" columns of \dAp to "Registered left/rig= ht type" I think that \dAp should additionally be changed to print the function via "oid::regprocedure", not just proname. A possible compromise, if you think that's too wordy, is to do it that way for "\dAp+" while printing plain proname for "\dAp". BTW, isn't this: " format ('%%s (%%s, %%s)',\n" " CASE\n" " WHEN pg_catalog.pg_operator_is_visible(op.oid= ) \n" " THEN op.oprname::pg_catalog.text \n" " ELSE o.amopopr::pg_catalog.regoper::pg_catalo= g.text \n" " END,\n" " pg_catalog.format_type(o.amoplefttype, NULL),\n= " " pg_catalog.format_type(o.amoprighttype, NULL)\n= " " ) AS \"%s\"\n," just an extremely painful way to duplicate the results of regoperator? (You could likely remove the joins to pg_proc and pg_operator altogether if you relied on regprocedure and regoperator casts.) > I'm not yet convinced we should change the sort key for \dAo. After playing with this more, I'm less worried about that than I was. I think I was concerned that the operator name would sort ahead of amopstrategy, but now I see that the op name isn't part of the sort key at all. BTW, these queries seem inadequately schema-qualified, notably the format() calls. regards, tom lane