Re: Dump only functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2013 at 1:43 PM, Raghavendra <raghavendra.rao@xxxxxxxxxxxxxxxx> wrote:
On Wed, Mar 27, 2013 at 10:53 PM, Keith Ouellette <Keith.Ouellette@xxxxxxxxxx> 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

 




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux