Re: Dump only functions

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: Keith Ouellette <Keith(dot)Ouellette(at)airgas(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Dump only functions
Date: 2013-03-27 17:43:12
Message-ID: CA+h6AhjvvTx_KSC7yivxaF_Wftnc7qAKZP2wJL8VWG4Wd5+ROQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Mar 27, 2013 at 10:53 PM, Keith Ouellette <
Keith(dot)Ouellette(at)airgas(dot)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.
http://www.keithf4.com/pg_extractor/

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

>
>
> Thanks,
>
> Keith
>
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Vasilis Ventirozos 2013-03-27 17:48:36 Re: Dump only functions
Previous Message Keith Ouellette 2013-03-27 17:23:09 Dump only functions