Re: Backing Up Partial Databases

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Shane Ambler <pgsql(at)007Marketing(dot)com>
Cc: Duncan McDonald <duncan(at)gpats(dot)com(dot)au>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Backing Up Partial Databases
Date: 2006-10-26 21:40:01
Message-ID: 20061026214001.GK26892@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Oct 26, 2006 at 04:08:05PM +0930, Shane Ambler wrote:
> >I have two identical databases (primary and backup) and I need to
> >transfer a small portion of missing data from one to the other. Is there
> >an easier way to do this rather than SELECT-ing the interval then
> >parsing the ouput to look like INSERT statements?
> >
>
> I can think of a couple of ways -
>
> COPY (SELECT * FROM myPrimaryTable WHERE id<200) TO '/tmp/myData';

Only in 8.2...

> the --inserts option of pg_dump will export as INSERT's if that is the
> way you want to do it. You will need to do a find and replace on the
> INSERT's to change the table name though.

Though, I don't see any reason you'd want to do that; just stick with
the pg_dump defaults.

Another option is to use dbi_link.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Joshua Marsh 2006-10-26 21:51:13 Re: CLUSTER using more memory than expected
Previous Message Jim C. Nasby 2006-10-26 21:37:21 Re: Vacuum Problems (locking)