Re: Dump only functions

Поиск
Список
Период
Сортировка
От Keith Ouellette
Тема Re: Dump only functions
Дата
Msg-id 417C5AF7C228B94490192951394BEFE7AF094E@AIPHLEXDAG01B.airgas.com
обсуждение исходный текст
Ответ на Re: Dump only functions  (Scott Mead <scottm@openscg.com>)
Ответы Re: Dump only functions  (Vasilis Ventirozos <v.ventirozos@gmail.com>)
Список pgsql-admin

Thank you. I tried pg_extractor and it work almost perfect. I have just one question. We do overloading of a function name (using different parameters) and I think it puts all overlaoded functions in the same file (those with the same file name that is). Is there a way to separate them?

 

Thanks again for everyones help.

 

 


From: Scott Mead [scottm@openscg.com]
Sent: Wednesday, March 27, 2013 1:49 PM
To: Raghavendra
Cc: Keith Ouellette; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Dump only functions

On Wed, Mar 27, 2013 at 1:43 PM, Raghavendra <raghavendra.rao@enterprisedb.com> wrote:
On Wed, Mar 27, 2013 at 10:53 PM, Keith Ouellette <Keith.Ouellette@airgas.com> wrote:

Is there a way to dump only functions to a directory with each function as its own file in SQL format?

AFAIK, there's no direct way to dump each function to a separate file. However, you can use system-defined function or system table to retrieve function structure and then write them to separate file each by using bash or perl scripting.

select prosrc from pg_proc where proname='foo';
or
select pg_get_functiondef('foo(integer)'::regprocedure::oid); 
or 
Use other sources like pg_extractor tools. 

+1 here.  pg_extractor is my personal favorite for this type of thing. It can give you all of your objects as separate files if you'd like.

--Scott
 

---
Regards,
Raghavendra
EnterpriseDB Corporation

 

 

Thanks,

Keith

 



В списке pgsql-admin по дате отправления:

Предыдущее
От: "suhas.basavaraj12"
Дата:
Сообщение: VACUUM ANALYZE AND ANALYZE ISSUE
Следующее
От: Vasilis Ventirozos
Дата:
Сообщение: Re: Dump only functions