Query Procedures

From: Andrea Adami <fol(at)fulcro(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Query Procedures
Date: 2016-04-21 15:26:20
Message-ID: CAJgnxO--vvXjvRrE4Y9qdn_GMhkh5OgFSxXzQvhU7RfFL2hM-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

thank you in advance
Andrea Adami

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2016-04-21 15:28:52 Wire protocol change
Previous Message Kevin Grittner 2016-04-21 14:58:25 Re: [COMMITTERS] pgsql: Inline initial comparisons in TestForOldSnapshot()