Re: Query Procedures

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Andrea Adami <fol(at)fulcro(dot)net>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Query Procedures
Date: 2016-04-21 15:48:53
Message-ID: CAKFQuwbqD=_iH45f47YNoyShaTPEQJw+bvqaHQRg6cP1F4x3WA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 21, 2016 at 8:26 AM, Andrea Adami <fol(at)fulcro(dot)net> wrote:

>
> Hello, i'm a developer from italy and i need to make a query to get the
> list of stored procedures with its signature.
> Basically I would like to get the same list pgAdmin shows under the node
> functions of the database tree on left panel. with the query : p.oid AS
> SELECT oid , p.proname AS name , p.proargtypes FROM pg_proc p I get the
> list of procedures with the column "proargtypes" that contains the list
> of parameters's type.
> Each digit of proargtypes column refers to the corresponding tuple in
> pg_type So far all is fine, the problems arise when i want convert these
> numbers to strings as the previously mentioned pgAdmin did: 1 ) in typname
> column (of pg_type table) some time, I did not understand why , there is a
> space in front of the name , better: a space is displayed but there is not
> a space because a trim do not throw away . 2 ) I can not understand what
> colums tell me if the type of data in question is an array ( to display it
> with ' [ ] ' appended to the name ) Someone is kind enough to put me on the
> right track ?
>
> p.s.
> the function: pg_catalog.pg_get_function_arguments(p.oid) show what i need
> but after the parameter name, what i want is a list of parameter's datatype
> (the signature) without the parameter's name
>
>
​Using text as an example the system considers the type "_text" to be its
array form. As you sure that what you are thinking is a leading space is
not this leading underscore?

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2016-04-21 16:25:10 Re: Typos/Questions in bloom documentation
Previous Message Tatsuo Ishii 2016-04-21 15:28:52 Wire protocol change