OIDs

From: "Guthrie, John" <JGuthrie(at)air(dot)org>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: OIDs
Date: 2002-06-03 14:42:05
Message-ID: F779B05379CAD2118BD20090273017BF03E79BEF@dc1.air.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a couple of questions about OIDs....

First, why would one choose to not use an OID as the
primary-key/foreign-key-reference for a table? It is unique (good thing) and
lacks business meaning (another good thing), so it seems to me to be just
the thing, a nice surrogate key. Is it just because of the name? I would
agree that as a foreign key reference a la:

create table employee_child (
parent oid references employee(oid),
name varchar(4) ....

looks kind of bad, but that is the worst drawback my
non-postgresql-experienced brain can conjure up.

Second, what is the scale of an OID? Does it map to an INT4 or an INT8? I
will be accessing the data via JDBC so I need to know what java type to use.

Third, is there any bottleneck or other problem associated with using OIDs
versus turning them off and using a self-defined SERIAL field? Or is the
opposite true?

Thanks!
John

-+-+-+-+-+-+-+-+-
john guthrie
american institutes for research
jguthrie(at)air(dot)org
202-298-2716

Responses

  • Re: OIDs at 2002-06-03 16:27:50 from Josh Berkus

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2002-06-03 16:27:50 Re: OIDs
Previous Message Reinhard Hnat 2002-06-03 14:31:30 Changed function