Re: [GENERAL] OID Question - Mailing list pgsql-novice

From Richard Huxton
Subject Re: [GENERAL] OID Question
Date
Msg-id 4193A648.8070501@archonet.com
Whole thread Raw
In response to OID Question  (Terry Lee Tucker <terry@esc1.com>)
List pgsql-novice
Terry Lee Tucker wrote:
> Greetings,
>
> Here is a simple question:
>
> Is it ok to put a unique index on the oid for my tables? We are in the process
> of moving from Progress Software to PostgreSQL. In the Progress world, you
> can always uniquely, and quickly find a record by using their version of oid,
> which is recid.  I remember reading somewhere that the oid could be
> duplicated across the cluster, but would not be duplicated in a single table.
> Maybe I dreamed it. What is the recommendation regarding this and why?

Just create a "recid" field of type SERIAL and add a unique constraint.
You can create tables WITHOUT OIDS if you want to reclaim some space in
the process.

OIDs will wrap around and are only guaranteed to be unique in
system-tables IIRC.

--
   Richard Huxton
   Archonet Ltd

pgsql-novice by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: cleaning up template1
Next
From: "Uwe C. Schroeder"
Date:
Subject: Re: [GENERAL] OID Question