Re: psql \df choose functions by their arguments - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql \df choose functions by their arguments
Date
Msg-id 1723993.1617831579@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql \df choose functions by their arguments  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: psql \df choose functions by their arguments  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: psql \df choose functions by their arguments  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Greg Sabino Mullane <htamfids@gmail.com> writes:
> I like the wildcard aspect, but I have a few issues with the patch:

> * It doesn't respect some common abbreviations that work elsewhere (e.g.
> CREATE FUNCTION). So while "int4" works, "int" does not. Nor does "float",
> which thus requires the mandatory-double-quoted "double precision"

"\dT int" doesn't match anything either.  Maybe there's room to improve
on that, but I don't think this patch should deviate from what \dT does.

> * Adding commas to the args, as returned by psql itself via \df, provides
> no matches.

The docs are fairly clear that the args are to be space-separated, not
comma-separated.  This fits with psql's general treatment of backslash
arguments, and I think trying to "improve" on it will just end badly.

> * There seems to be no way (?) to limit the functions returned if they
> share a common root. The previous incantation allowed you to pull out
> foo(int) from foo(int, bigint). This was a big motivation for writing this
> patch.

Hmm, are you trying to say that a invocation with N arg patterns should
match only functions with exactly N arguments?  We could do that, but
I'm not convinced it's an improvement over what I did here.  Default
arguments are a counterexample.

> * SQL error on \df foo a..b as well as one on \df foo (bigint bigint)

The first one seems to be a bug, will look.  As for the second, I still
don't agree that that should be within the mandated syntax.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: multi-install PostgresNode fails with older postgres versions
Next
From: Julien Rouhaud
Date:
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?