Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA00861; Fri, 1 Nov 91 09:11:03 -0800
Message-Id: <9111011711.AA00861@postgres.Berkeley.EDU>
From: Peter van Oosterom <Peter.van.Oosterom@tnofel.fel.tno.nl>
Subject: oid mapping
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
To: postgres@postgres.berkeley.edu
Date: Fri, 1 Nov 91 18:14:21 MET
Cc: tom@izf.tno.nl
X-Mailer: ELM [version 2.3 PL11]

Dear Postgres group,

The reference manual distributed with version 2.0.3 contained a section
on oid mapping in the postquel copy command. This section has disappeared
in the latest reference manual. However, oid mapping is important in case
you want to copy a database from one postgres installation to another.
The oid mapping described in reference manual version 2.0.3 is not
sufficient for this purpose. The auxiliary relation which
contains the mapping of old oid's to new oid's can not be filled
because the copy to and from are performed on two different installations.

A reasonable solution for the oid mapping is illustrated with an example:
ON SYSTEM A:
   create people(name=char16,parent=oid)
   append's.....
   retrieve into cppeople (oldoid=people.oid, people.all)
   copy cppeople to "/tmp/people.data"

(transport file /tmp/people.data from A to B)
ON SYSTEM B:
   create people(oldoid=oid,name=char16,parent=oid)
   copy people from "/tmp/people.data"
   replace people(parent=p.oid) from p in people where p.oldoid=people.parent
   dropattr (oldoid) from people

Everything works, except the last two lines. The replace command causes an
infinite loop. Of course the command dropattr is not present, but it
should be able to implement this similar to addattr.
Another disadvantage is that this method is clumsy. For example the
cppeople-relation would not be needed if something like
   copy people(oldoid=oid,all) to "/tmp/people.data"
was possible. Is there a (better) method to solve this problem?

Regards, Peter van Oosterom.
