Help working with arrays / vectors - Mailing list pgsql-novice

From Brett Krebs
Subject Help working with arrays / vectors
Date
Msg-id 01CC21318F15D6118A3D00E0293067544BC722@SULU
Whole thread Raw
Responses Re: Help working with arrays / vectors
List pgsql-novice
Hello all, I am trying to write a function akin to M$'s (or Sybase's) sp_helptext, which basically returns the definition of a stored procedure (or function, in this case.)  Using pl/pgSQL I have written a function that returns the body of a given function by returning the corresponding prosrc attribute from pg_proc.  The difficulty comes in figuring out a way to also return the parameters required by the function.  I am aware that the pronargs attribute contains the number of arguments, and the proargtypes attribute contains an array (vector) of the oids of the argument types.  That's where I get stuck, I haven't found any documentation detailing a method for manipulating vectors in pl/pgSQL.  Is there a way to fetch an oidvector type directly into an array and then manipulate the array?  If not, is there a "best method" for fetching the oidvector into a text variable and parsing it to create an array? 
 
Better yet, has anyone out there who knows what they're doing already written a similar function.  I'm not too proud to borrow code.
 
Thanks in advance,
Brett

pgsql-novice by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Expect and scripting.
Next
From: Tom Lane
Date:
Subject: Re: Help working with arrays / vectors