how to append records from dump to existing database? - Mailing list pgsql-general

From wetter wetterana
Subject how to append records from dump to existing database?
Date
Msg-id CAMPbDaVXXq_XxL7g+h+LRnzocHUGaeRTST+8jZ+F12DH7gtxhg@mail.gmail.com
Whole thread Raw
Responses Re: how to append records from dump to existing database?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi,

I would like to know how I could append a database dump to an existing database without clearing it.

Example: I got a database 'db' with a tables 't1' including variables 'var1' and 'var2', and table 't2' with variables 'var3' and 'var4'.  Earlier this year, I stored records 1 to 100 in this database and dumped the whole database to a file 'dump1'.  Then I cleared the tables and began collecting new records 101 - 200.  All variables are the same, no ownership has changed, etc. 

Now I would like to append the records 1-100 from dump1 to the existing database.  How could I use pg_dump or another command to append records 1-100 to the existing database? Please note that I do not have enough space to first recreate the database from the dump and then merge it with the newer one. 

More generally, knowing that I will have to do this periodically, how can I best dump current records to ease later merging/appending?

Thanks!!

Ana    

pgsql-general by date:

Previous
From: stefano bonnin
Date:
Subject: BDR conpilation error un Ubuntu 12.4 LTS
Next
From: Giuseppe Broccolo
Date:
Subject: Re: BDR conpilation error un Ubuntu 12.4 LTS