pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: output columns of \dAo and \dAp
Date: Sat, 11 Jul 2020 15:59:12 -0400
Message-ID: <2448026.1594497552@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPpHfdty+_zFZjma-wwnrzLkADymJTgQQ+wVtcqKZ+nz1=J4cQ@mail.gmail.com>
References: <2edc7b27-031f-b2b6-0db2-864241c91cb9@2ndquadrant.com>
	<1698998.1591479248@sss.pgh.pa.us>
	<CAPpHfdvkuAZ4KgE+5U08vDzw81pqzM_abJAT1h3oRem_4w0rMQ@mail.gmail.com>
	<d78c76c2-6e69-078c-6c03-16bbe8b4a5af@postgresql.org>
	<CAPpHfdsFhRqEhjOCSfQj0mmcOyJHCM6T7Hj7UifjUcVUNe5Pxw@mail.gmail.com>
	<CAPpHfdty+_zFZjma-wwnrzLkADymJTgQQ+wVtcqKZ+nz1=J4cQ@mail.gmail.com>

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





view thread (12+ messages)  latest in thread

Message-ID: <2448026.1594497552@sss.pgh.pa.us>
Permalink:  ../2448026.1594497552@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2448026.1594497552@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, aekorotkov@gmail.com, jkatz@postgresql.org, peter.eisentraut@2ndquadrant.com
  Subject: Re: output columns of \dAo and \dAp
  In-Reply-To: <2448026.1594497552@sss.pgh.pa.us>

* 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