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

From Andrew McMillan
Subject Re: Question on oid's
Date
Msg-id 1018432978.25916.1091.camel@kant.mcmillan.net.nz
Whole thread Raw
In response to Re: Question on oid's  ("Joseph Molnar" <josephmolnar@hotmail.com>)
List pgsql-novice
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?


pgsql-novice by date:

Previous
From: "Joseph Molnar"
Date:
Subject: Re: Question on oid's
Next
From: "Joshua b. Jore"
Date:
Subject: Re: INSERT failing because of CONSTRAINT