Re: bugfix: --echo-hidden is not supported by \sf statements - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: bugfix: --echo-hidden is not supported by \sf statements
Date
Msg-id 20130224060441.GE16142@tamriel.snowman.net
Whole thread Raw
In response to Re: bugfix: --echo-hidden is not supported by \sf statements  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: bugfix: --echo-hidden is not supported by \sf statements
Re: bugfix: --echo-hidden is not supported by \sf statements
List pgsql-hackers
* Pavel Stehule (pavel.stehule@gmail.com) wrote:
> it is not possible - both fragments has different purpose. Code in \ef
> or \sf should to select exactly one function based on complete
> function signature, \df try to show list of functions filtered by
> name.

I don't buy that argument.  You could use the same code and simply
complain if multiple functions are returned from the query.  That's the
point- when you actually query the catalog instead of just trying to use
the cast functions, you can do things like detect how many records are
returned and do something sensible.

> 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.

> It is not hard problem - just a some about 100 lines - but it
> is going out of original proposal, so I am asking if we want this and
> more code will be accepted.

I don't see any reason nor need to change regproc or regprocedure.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: bugfix: --echo-hidden is not supported by \sf statements
Next
From: Steve Singer
Date:
Subject: Re: json generation enhancements