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

From: leonbloy(at)sinectis(dot)com(dot)ar
To: 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 22:37:26
Message-ID: 200004282237.TAA15887@rye.sinectis.com.ar
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?

I had the same doubt, but found no clear answer. Apparently,
it's not very important...

>If
> PostgreSQL references all data by OID internally, then this would cause an
OID
> to reference more than one object - a possible ambiquity?
>

It would seem so...

> 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.
>
> Any caveats or experiences anyone can share would be great!
>
> Robert B. Easter
> reaster(at)comptechnews(dot)com
>

I had used oids as row identifiers (keys), but decided to change
everything to Serial type.
Oids are postgresql-specific ('normally invisible); the lack
of portability, and some doubts whether the backup/restore
process was clean using -o , lead me to use Sequences instead.
After all, what one usually wants is a identifier unique within
a table.

I've read the chapters from Bruce's book. Though they are clear,
it seems to me that, (assuming that the book is directed towards
novices, and implementing row identifiers is one of the firt
issues that arise when designing a database) IMHO oids
should be rather discoureged.

Cheers

Hernan Gonzalez
Buenos Aires, Argentina

Browse pgsql-general by date

  From Date Subject
Next Message James R. R. Service 2000-04-29 01:00:36 Re: Read Only from ODBC
Previous Message Bruce Momjian 2000-04-28 19:56:05 Re: Restoring old database with OIDs that are now in use by another database after initdb = problems?