oid as a reference

Поиск
Список
Период
Сортировка
От Don Yury
Тема oid as a reference
Дата
Msg-id 3780524C.A4F90380@vpcit.ru
обсуждение исходный текст
Список pgsql-general
Hi All.

I am just designing my first database in postgres and have a question -
would it be proper if I use oid for referential integrity? In all
examples I saw something like
Create table master(
id int4,
...
);

Create table detail(
master_id int4,
....
);

CREATE TRIGGER bt BEFORE INSERT OR UPDATE ON detail FOR EACH ROW
EXECUTE PROCEDURE
check_primary_key ('REFB', 'A', 'ID');


But since each object in database have an oid as an indenificator, we
can:
[- create master table without id]
- create unique index on oid for master table
- in the field master_id of detail table store oid of appropriate master
object
- create function check_oid() in order to use it in trigger for
referential integrity
Would it be a proper design?

Sincerely yours, Yury.
don.web-page.net, ICQ 11831432

В списке pgsql-general по дате отправления:

Предыдущее
От: Felix Morley Finch
Дата:
Сообщение: Curiousity about indexing, again
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: [GENERAL] oid as a reference