Re: Question on oid's

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
Subject: Re: Question on oid's
Date: 2002-04-10 10:02:58
Message-ID: 1018432978.25916.1091.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(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?

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Joshua b. Jore 2002-04-10 13:22:49 Re: INSERT failing because of CONSTRAINT
Previous Message Joseph Molnar 2002-04-10 06:38:17 Re: Question on oid's