From: Bruno Feurer <bfeurer@itr.ch>
To: pgsql-sql@postgresql.org
Subject: Merging databases
Date: Thu, 19 Nov 1998 12:19:46 +0100
Message-ID: <3653FED1.28BC66F0@hsr.ch> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: bfeurer@itr.ch
Subject: Re: Merging databases
In-Reply-To: <3653FED1.28BC66F0@hsr.ch>
References: <3653FED1.28BC66F0@hsr.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox