Question about backing up partial Database - Mailing list pgsql-general

From David Link
Subject Question about backing up partial Database
Date
Msg-id 429DDAB0.6010001@soundscan.com
Whole thread Raw
List pgsql-general
Hi,

Can pg_dump be used to backup a selected number of tables, (rather than
All or One)?

We have a case where we need to backup tables of the form sale_2001xx,
or sale_2002xx, etc.

Our current solution is the following:

   pg_dump -d dbname -t sale_200101 >  sales_2001_dump
   pg_dump -d dbname -t sale_200102 >>  sales_2001_dump
   pg_dump -d dbname -t sale_200103 >>  sales_2001_dump
   ..
   pg_dump -d dbname -t sale_200152 >>  sales_2001_dump
  gzip sale_2001_dump

However this requires more diskspace and more db connection over head than:

   pg_dump -d dbname | gzip sales_2001_dump.gz

Currently all the tables are in the public namespace.  We've had trouble
in the past for our perl program to work with multiple schema names.

Thank you for your help any suggestions.
Sincerely,
David Link
White Plains, NY






pgsql-general by date:

Previous
From: "Gerald D. Anderson"
Date:
Subject: Re: Old problem needs solution
Next
From: Manuel García
Date:
Subject: Re: Can I catch sentences in SQL using triggers?