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