Re: Restoring old database with OIDs that are now in use by another database after initdb = problems?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Restoring old database with OIDs that are now in use by another database after initdb = problems?
Date: 2000-04-28 19:56:05
Message-ID: 200004281956.PAA10822@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> I'm wondering what would happen if I were to backup/archive an old
> database with OIDs, then later someday, restore it after I've since done an
> initdb and there is someother database using the same OIDs as the old database.
> If I restore with OIDs, that would cause the OIDs to not be unique within
> the entire data directory. Would PostgreSQL have any problems with this? If
> PostgreSQL references all data by OID internally, then this would cause an OID
> to reference more than one object - a possible ambiquity?

Having duplicates in different tables really is not a problem.

>
> I'm trying to decide whether to use OIDs or sequences for unique ids. I want
> to use the method that will work most reliably. Trouble free backup and
> restore is very important. OIDs look good since they are always there so they
> are simple and there's little you can do to misconfigure them.
> Serials/sequences might be better if I need sequential numbers but I don't
> really - just unique is good enough. Again, I want to use what is simplest
> but more importantly, that stands the best chance of not being corrupted
> during backup/restore.
>

My book has a chapter on this:

http://www.postgresql.org/docs/awbook.html

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message leonbloy 2000-04-28 22:37:26 Re: Restoring old database with OIDs that are now in use by another database after initdb = problems?
Previous Message Robert B. Easter 2000-04-28 18:41:37 Restoring old database with OIDs that are now in use by another database after initdb = problems?