Thread: Importing data only

Importing data only

From
Lisa Goulet
Date:
Hi,

I've set up a secondary server and want to keep the db updated with a
combination of pgdump and rsync. Here's what I do:

pgdump -a mydb > mydb.pgdump
cat mydb.pgdump | psql mydb

which results in several "Cannot insert a duplicate key into unique index"
errors. What's the best way to overwrite existing data without a
dropdb+createdb etc?

Thanks in advance,
Lisa

Re: Importing data only

From
Anand Raman
Date:
If u dont want to recreate the db , u will have to atleast delete the
data before moving on .. Try a delete * from <ur_table> and then
import..

Thanks
Anand

On Wed, Mar 07, 2001 at 03:58:16PM +0100, Lisa Goulet wrote:
>Hi,
>
>I've set up a secondary server and want to keep the db updated with a
>combination of pgdump and rsync. Here's what I do:
>
>pgdump -a mydb > mydb.pgdump
>cat mydb.pgdump | psql mydb
>
>which results in several "Cannot insert a duplicate key into unique index"
>errors. What's the best way to overwrite existing data without a
>dropdb+createdb etc?
>
>Thanks in advance,
>Lisa
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster