Re: [GENERAL] searching oid's

From: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
To: admin <admin(at)wtbwts(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] searching oid's
Date: 2000-01-14 07:39:38
Message-ID: 387ED2BA.2916CEB5@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

admin wrote:

> Actually, I think pg_dump with the -o flag keeps oid's, therefore allowing
> me to keep referential integrity after backup.
>
> > Using oid's is not a good idea, as they don't automatically get dumped with
> > pg_dump. And once your referential integrity gets screwed up and you are
> > using oid's you are really in a mess, as you cannot change oids. Use a serial
> > field to generate a key for every row, which generates you a sequence of
> > integers. It is much better than oids at a cost of 4 bytes.

Yes oids get dumped with the -o flag. That is why I said automatically. Fact
remains that you cannot manipulate oids. Should you ever want to copy a table into
an exisiting system you would have to do a new initdb to make sure that the oids
in your table are not in use. And if anything ever gets corrupted it is much
harder to recover and fix it, as you have no control over the oid values that the
system assigns. I would definitely recommend a separate serial value, and I
believe this is also what is recommended in the postgres docs.

Adriaan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Borek Lupomesky 2000-01-14 07:45:55 Does patch for GROUP BY/aggr. bug exist?
Previous Message Risko Peter 2000-01-14 06:23:24 Re: Slightly OT: outer joins