Re: Question on oid's - Mailing list pgsql-novice

From Joseph Molnar
Subject Re: Question on oid's
Date
Msg-id OE21gTV7sWIFDSFSbnE000138fb@hotmail.com
Whole thread Raw
In response to Re: Question on oid's  ("Josh Berkus" <josh@agliodbs.com>)
List 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@catalyst.net.nz>
To: "Joseph Molnar" <josephmolnar@hotmail.com>
Cc: "Josh Berkus" <josh@agliodbs.com>; <pgsql-novice@postgresql.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@agliodbs.com>
> > To: "Juliet May" <jmay@speark.com>; <pgsql-novice@postgresql.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
>

pgsql-novice by date:

Previous
From: "Duncan Adams (DNS)"
Date:
Subject: sql question
Next
From: "Josh Berkus"
Date:
Subject: Re: Question on oid's