Re: bugfix: --echo-hidden is not supported by \sf statements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Josh Kupershmidt <schmiddy(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bugfix: --echo-hidden is not supported by \sf statements
Date: 2013-02-26 19:29:48
Message-ID: 512D0D2C.50107@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 02/26/2013 02:12 PM, Tom Lane wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
>> * Pavel Stehule (pavel(dot)stehule(at)gmail(dot)com) wrote:
>>> Minimally \ef needs exact specification - you cannot to edit more
>>> functions in same time. So we have to be able identify if there are no
>>> selected function or if there are more functions. We can write a
>>> auxiliary function that returns list of function oids for specified
>>> signature - but it is relative much more code and it is hard to
>>> implement for older versions - but we can use regproc and regprocedure
>>> there.
>> Using regproc and regprocedure is the wrong approach here and will be a
>> pain to maintain as well as a backwards incompatible change to how they
>> behave. We have solved this problem already and what \df does is exactly
>> the right answer.
> Well, actually I think Pavel's got a point. What about overloaded
> functions? In \df we don't try to solve that problem, we just print
> them all:
>
> regression=# \df abs
> List of functions
> Schema | Name | Result data type | Argument data types | Type
> ------------+------+------------------+---------------------+--------
> pg_catalog | abs | bigint | bigint | normal
> pg_catalog | abs | double precision | double precision | normal
> pg_catalog | abs | integer | integer | normal
> pg_catalog | abs | numeric | numeric | normal
> pg_catalog | abs | real | real | normal
> pg_catalog | abs | smallint | smallint | normal
> (6 rows)
>
> In \ef you need to select just one of these functions, but \df doesn't
> have any ability to do that:
>
> regression=# \df abs(int)
> List of functions
> Schema | Name | Result data type | Argument data types | Type
> --------+------+------------------+---------------------+------
> (0 rows)
>
> Now, maybe we *should* teach \df about handling parameter types and
> then \ef can piggyback on it, but that code isn't there now.
>
>

If we're going to mess with this area can I put in a plea to get \ef and
\sf to handle full parameter specs? I want to be able to c&p from the
\df output to see the function. But here's what happens:

andrew=# \df json_get
List of functions
Schema | Name | Result data type | Argument
data types | Type
------------+----------+------------------+-----------------------------------------------+--------
pg_catalog | json_get | json | from_json json, element
integer | normal
pg_catalog | json_get | json | from_json json,
VARIADIC path_elements text[] | normal
(2 rows)

andrew=# \sf json_get (from_json json, element integer )
ERROR: invalid type name "from_json json"

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-02-26 19:40:57 Re: bugfix: --echo-hidden is not supported by \sf statements
Previous Message Stephen Frost 2013-02-26 19:19:06 Re: bugfix: --echo-hidden is not supported by \sf statements