Re: OID Usage

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: OID Usage
Date: 2005-01-14 23:17:42
Message-ID: 20050114231726.GG1724@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 15, 2005 at 12:06:41AM +0100, Bo Lorentsen wrote:
> Martijn van Oosterhout wrote:
> >It means using OIDs as you described has very well known problems and
> >they will break on you eventually. You can mitigate the damage by
> >creating a UNIQUE index on the oid column but you'd better be sure your
> >application can handle the side-effects.
> >
> Ok, Tom told me about the same :-( But why are oid's still in PG, that
> are they good for ? Will there be a real unique row id, like there is in
> Oracle, or will this be keept as an internal value only ?

They're still there because the system tables use them. But for user
tables you use sequences which go up to 64 bit and have protection
against wraparound.

> Is this because some old application's using oid's in somewhat small
> dataset ?

Basically, OIDs are not useful in user tables, they're not unique, have
no special priveledges w.r.t. other columns. All they do is take up
extra storage space. Basically, the use of OIDs has been discouraged
for a long time now and it's finally getting to the stage where they'll
be disabled on user tables by default.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2005-01-14 23:24:38 Re: OID Usage
Previous Message Aly Dharshi 2005-01-14 23:14:35 Re: ntfs for windows port rc5-2