Re: psql \df choose functions by their arguments

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-04-07T19:57:31Z
Lists: pgsql-hackers

Attachments

Greg Sabino Mullane <htamfids@gmail.com> writes:
>  [ v6-psql-df-pick-function-by-type.patch ]

I looked this over.  I like the idea a lot, but not much of anything
about the implementation.  I think the additional arguments should be
matched to the function types using the same rules as for \dT.  That
allows patterns for the argument type names, which is particularly
useful if you want to do something like
	\df foo * integer
to find functions whose second argument is integer, without restricting
the first argument.

As a lesser quibble, splitting the arguments with strtokx is a hack;
we should let the normal psql scanner collect the arguments.

So that leads me to the attached, which I think is committable.  Since
we're down to the last day of the CF, I'm going to push this shortly if
there aren't squawks soon.

			regards, tom lane

Commits

  1. Allow psql's \df and \do commands to specify argument types.