Re: oids as primary keys?

From: Olivier Thauvin <olivier(dot)thauvin(at)aerov(dot)jussieu(dot)fr>
To: "Cima" <ruel(dot)cima(at)facinf(dot)uho(dot)edu(dot)cu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: oids as primary keys?
Date: 2005-04-15 15:59:09
Message-ID: 200504151759.14863.olivier.thauvin@aerov.jussieu.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Le Saturday 16 April 2005 00:42, Cima a écrit :
> hi ,
>
> someone has drawn my attention to the fact that oids may not be such a good
> idea to set as a primary key in a table. i have designed a relativley large
> database and defined oids as primary keys. i would like your opinions or
> recomendations on this.

It's surelly me, I reply to you directly instead to the list :(

About this I find where I read the warning:
http://www.postgresql.org/docs/8.0/interactive/datatype-oid.html

where you can read:

"The oid type is currently implemented as an unsigned four-byte integer.
Therefore, it is not large enough to provide database-wide uniqueness in
large databases, or even in large individual tables. So, using a user-created
table's OID column as a primary key is discouraged. OIDs are best used only
for references to system tables."

Notice it is maybe not a problem for you currently.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Frank Bax 2005-04-15 16:00:30 Re: oids as primary keys?
Previous Message Lance Massey 2005-04-15 13:22:31 query syntax question