pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jim@nasby.net>
To: Shane Ambler <pgsql@007Marketing.com>
Cc: Duncan McDonald <duncan@gpats.com.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: Backing Up Partial Databases
Date: Thu, 26 Oct 2006 16:40:01 -0500
Message-ID: <20061026214001.GK26892@nasby.net> (raw)
In-Reply-To: <454057CD.5030401@007Marketing.com>
References: <018701c6f8ac$0ad93bf0$2102a8c0@Firefly>
	<454057CD.5030401@007Marketing.com>

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@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



view thread (3+ messages)

Message-ID: <20061026214001.GK26892@nasby.net>
Permalink:  ../20061026214001.GK26892@nasby.net/
Also on:    postgresql.org/message-id/20061026214001.GK26892@nasby.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jim@nasby.net, pgsql@007Marketing.com, duncan@gpats.com.au
  Subject: Re: Backing Up Partial Databases
  In-Reply-To: <20061026214001.GK26892@nasby.net>
  References: <018701c6f8ac$0ad93bf0$2102a8c0@Firefly> <454057CD.5030401@007Marketing.com> <20061026214001.GK26892@nasby.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox