Help working with arrays / vectors

Поиск
Список
Период
Сортировка
От Brett Krebs
Тема Help working with arrays / vectors
Дата
Msg-id 01CC21318F15D6118A3D00E0293067544BC722@SULU
обсуждение исходный текст
Ответы Re: Help working with arrays / vectors
Список 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 по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Expect and scripting.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Help working with arrays / vectors