Re: output columns of \dAo and \dAp - Mailing list pgsql-hackers

From Tom Lane
Subject Re: output columns of \dAo and \dAp
Date
Msg-id 2448026.1594497552@sss.pgh.pa.us
Whole thread Raw
In response to Re: output columns of \dAo and \dAp  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: output columns of \dAo and \dAp  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
Alexander Korotkov <aekorotkov@gmail.com> 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/right 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_catalog.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Towards easier AMs: Cleaning up inappropriate use of name "relkind"
Next
From: Alvaro Herrera
Date:
Subject: Re: min_safe_lsn column in pg_replication_slots view