Re: Question on oid's

From: "Joseph Molnar" <josephmolnar(at)hotmail(dot)com>
To: "Andrew McMillan" <andrew(at)catalyst(dot)net(dot)nz>
Cc: "Josh Berkus" <josh(at)agliodbs(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Question on oid's
Date: 2002-04-10 15:56:29
Message-ID: OE21gTV7sWIFDSFSbnE000138fb@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hmm, so I guess they did that to get around the problem of converging an
already loaded set and what was on disk..which basically means their
algorithm for oid creation is not guaranteeing uniqueness between
'installations'. That does seem a bit strange. It is not uncommon (love
double-negatives ;) in an OR system to form a relationship along an OID and
then building application level (or stored procs) constraints to guarantee
the object is of the right type (ie an Address can be owned-by a Person or a
Company, but not an Invoice).

What are oid's used for then, other than simple DB management? I would
presume that they cannot be used by the inheritance relationships or other
interesting features of Postgresql since they would fall into the same
issues as above..??

Joe

----- Original Message -----
From: "Andrew McMillan" <andrew(at)catalyst(dot)net(dot)nz>
To: "Joseph Molnar" <josephmolnar(at)hotmail(dot)com>
Cc: "Josh Berkus" <josh(at)agliodbs(dot)com>; <pgsql-novice(at)postgresql(dot)org>
Sent: Wednesday, April 10, 2002 3:02 AM
Subject: Re: [NOVICE] Question on oid's

> On Wed, 2002-04-10 at 18:38, Joseph Molnar wrote:
> > I am also new to Postgresql though not ORDBMS systems ... why should you
not
> > use OIDs as a primary key in Postgresql?
>
> Because they will be different next time you load your data from a dump.
>
> Cheers,
> Andrew.
> >
> > ----- Original Message -----
> > From: "Josh Berkus" <josh(at)agliodbs(dot)com>
> > To: "Juliet May" <jmay(at)speark(dot)com>; <pgsql-novice(at)postgresql(dot)org>
> > Sent: Tuesday, April 09, 2002 11:19 PM
> > Subject: Re: [NOVICE] Question on oid's
> >
> >
> > > Juliet,
> > >
> > > > My first question is about oid's. What are they exactly and when
> > > > should/shouldn't I use them. I had trouble finding any information
on
> > > > them in either the online documentation or the online books. I'm
> > > > using pgadmin to develop my database and I noticed that once I
select
> > > > or don't select oid that I can't change my mind.
> > >
> > > We need a FAQ on this. Sigh.
> > >
> > > OIDs are for system use. Occasionally some developers will build
> > > transaction tables, to which thousands or millions of records will be
> > > written and erased per day. For that case (and that case only) they
> > > will build "OID-less tables" in Postgres 7.2.
> > >
> > > Otherwise, you should build your tables with OIDs, but then ignore the
> > > OIDs and not use them as an index. The system helps by "hiding" the
> > > OID column from you.
>
> I don't agree with this statement though. I don't personally see much
> value in having OID's in my tables in general. Obviously they are
> needed for (most) system tables, but why should I bother with them
> normally.
>
> What system use is made of OIDs in non-system tables? None?
>
>
> > > Should you run across documentation suggesting that you use the OID as
> > > an index or primary, key, that documentation is outdated.
>
> And was possibly suspect in the first place.
>
> Cheers,
> Andrew.
>
> --
> --------------------------------------------------------------------
> Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
> WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
> DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
> Are you enrolled at http://schoolreunions.co.nz/ yet?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2002-04-10 16:02:07 Re: Question on oid's
Previous Message Duncan Adams (DNS) 2002-04-10 15:09:05 sql question