Re: [GENERAL] OID Question

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: [GENERAL] OID Question
Дата
Msg-id 4193A648.8070501@archonet.com
обсуждение исходный текст
Ответ на OID Question  (Terry Lee Tucker <terry@esc1.com>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: cleaning up template1
Следующее
От: "Uwe C. Schroeder"
Дата:
Сообщение: Re: [GENERAL] OID Question