Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f464a6A98534 for ; Sun, 6 May 2001 00:36:06 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f464a2R26981; Sun, 6 May 2001 00:36:02 -0400 (EDT) To: Oliver Vecernik cc: "pgsql-admin@postgresql.org" Subject: Re: general question on OIDs In-reply-to: <3AF436A6.8BFAC3FD@aon.at> References: <3AF436A6.8BFAC3FD@aon.at> Comments: In-reply-to Oliver Vecernik message dated "Sat, 05 May 2001 19:21:42 +0200" Date: Sun, 06 May 2001 00:36:02 -0400 Message-ID: <26978.989123762@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200105/27 X-Sequence-Number: 1367 Oliver Vecernik writes: > Using of OIDs as foreign keys is recommended in the docs. Er ... where? It shouldn't be. > But what happens if I have to upgrade my server? For example for the new > 7.1 release an initdb is required. OIDs start from 16384 or something. > After importing my old databases can I expect that OIDs are not unique > any more? Or is there any other handling to prevent this? This is why it shouldn't be. Reloading a pg_dump-with-OIDs will probably yield a conflict-free database, but it's not certain; and it is certain that you'll waste lots of OIDs that way. Much better to use serial columns for foreign keys. regards, tom lane