Received: from rz.itr.ch (root@rz-le3.itr.ch [152.96.192.70]) by hub.org (8.9.1/8.9.1) with ESMTP id GAA15025 for ; Thu, 19 Nov 1998 06:19:51 -0500 (EST) (envelope-from bfeurer@hsr.ch) Received: from hsr.ch (bfeurer@if-83 [152.96.129.103]) by rz.itr.ch (8.9.1a/8.9.1) with ESMTP id MAA14327 for ; Thu, 19 Nov 1998 12:19:47 +0100 (MET) Sender: bfeurer@itr.ch Message-ID: <3653FED1.28BC66F0@hsr.ch> Date: Thu, 19 Nov 1998 12:19:46 +0100 From: Bruno Feurer Organization: HSR Hochschule Rapperswil X-Mailer: Mozilla 4.5 [en] (X11; I; HP-UX B.10.20 9000/778) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Merging databases Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit 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