Merging databases
От | Bruno Feurer |
---|---|
Тема | Merging databases |
Дата | |
Msg-id | 3653FED1.28BC66F0@hsr.ch обсуждение исходный текст |
Список | 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@hsr.ch; WWW:www.hsr.ch
В списке pgsql-sql по дате отправления: