Re: pg_dump option to dump only functions

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Sean Utt <sean(at)strateja(dot)com>
Subject: Re: pg_dump option to dump only functions
Date: 2005-10-08 22:10:31
Message-ID: 20051008221031.GZ36108@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Oct 08, 2005 at 02:24:00PM -0700, Josh Berkus wrote:
> Sean,
>
> > I was wonderring, because I create a lot of server side utility functions,
> > whether adding an option to pg_dump to just dump functions has been
> > considered. I did a quick perusal of the code, and noted that there is a
> > separate section within pg_dump to get the functions, but it is not able to
> > be triggered separately from schema and data. Any reason why this wouldn't
> > be a good(tm) idea?
>
> It would be an *excellent* idea, along with options to dump specific
> functions, and both specific and all views/types/operators. Go for it.

Agreed. IMHO this should actually tie in with the discussion on -general
right now about better ways to specify includes and excludes. ISTM that
pg_dump should allow you to feed it a file that specifies what you do
and don't want dumped. That can be extended to include object type. One
possibile file format, off the top of my head:

<action> <objects> <filter> <options>

<action>
Roughly, dump or ignore. Can be object-dependant. For example, tables
could have these actions:
dump-ddl dumps DDL only for tables matching <filter>
dump-data dumps data only for tables matching <filter>
dump-all dumps DDL and data for tables matching <filter>
ignore ignores tables matching <filter>

<objects>
List of object types, or * for any object. IE: tables,views,indexes

<filter>
Regex of what this rule applies to

<options>
Would be useful to allow specifying if dependancies should be dumped.
Maybe some other things as well.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-08 22:51:55 Re: [HACKERS] A Better External Sort?
Previous Message Tom Lane 2005-10-08 22:03:40 Re: pg_dump option to dump only functions