Question about backing up partial Database

From: David Link <dlink(at)soundscan(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Question about backing up partial Database
Date: 2005-06-01 15:56:32
Message-ID: 429DDAB0.6010001@soundscan.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2005-06-01 16:06:18 Re: Newby to DB
Previous Message Alvaro Herrera 2005-06-01 15:56:09 Re: Old problem needs solution