Help working with arrays / vectors
От
Brett Krebs
Тема
Help working with arrays / vectors
Дата
Msg-id
01CC21318F15D6118A3D00E0293067544BC722@SULU
Список
Дерево обсуждения
Help working with arrays / vectors Brett Krebs <bkrebs@RINECO.COM>
Re: Help working with arrays / vectors Tom Lane <tgl@sss.pgh.pa.us>
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 по дате отправления