From: | Bruno Feurer <bfeurer(at)itr(dot)ch> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Merging databases |
Date: | 1998-11-19 11:19:46 |
Message-ID: | 3653FED1.28BC66F0@hsr.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hello everybody
I am very new at datamangement and I want to merge the data of two (or
more) databases.
My current "solution" and my problem:
- First the primary ids of the tables are unique over all the databases
(different offsets for each db). And I don't want to delete any records
(they just be marked as deleted), so I just want to get the combination
of the two databases.
- Then I COPY each table of the 1st db in a corresponding file.
- In the 2nd db I create an empty, comatible, temporary table (CREATE
TABLE tmptable AS SELECT * FROM table; DELETE FROM tmptable;) Does
somebody have a better,faster idea?
- Then I COPY the corresponding file into the temprary table.
- And I reached my problem step: How to get only the additional records
from the temporary table in the tableX??? Some of the tables have
compound primary keys.
- DROP the tmptable.
- The same thing for the other db.
Does somebody have a solution for my problem or even a better, faster
solution to merge
two databases.
I am using PostgreSQL 6.3.2 (soon 6.4) with the JDBC interface.
Thanks in advance for every replay!
Bruno
--
_ _ ___ ___ Bruno Feurer
| || / __| _ \ HSR Hochschule Rapperswil; Oberseestrasse 10;
| __ \__ \ / CH-8640 Rapperswil; Switzerland; Fax:+41 55 222 4400
|_||_|___/_|_\ EMAIL: bfeurer(at)hsr(dot)ch; WWW:www.hsr.ch
From | Date | Subject | |
---|---|---|---|
Next Message | G. Anthony Reina | 1998-11-19 22:11:28 | Postgres installed but my C programs won't compile |
Previous Message | Lendvary Gyorgy | 1998-11-18 15:12:08 | createdb problem |