Inheritance and primary key

Поиск
Список
Период
Сортировка
От Guillaume Rousse
Тема Inheritance and primary key
Дата
Msg-id 00011017381300.00654@agathe
обсуждение исходный текст
Ответы Re: [GENERAL] Inheritance and primary key  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
I use a super-class S (virtual, in fact) ans three inheritated classes S1, S2
and S3. i wish to have a primary key for all these classes, in order to use
queries as : SELECT * FROM S* WHERE s.id=x
I use a serial ID field for S as a primary key. Sequencing is OK, as any
insertion in any of the four classes increments the counter. But uniqueness
constraint is lost, as i can have duplicated values between differents classes.
And even in the same class for the inherited ones, as primary key propertie of
ID column is lost through inheritance. And i can't specify a unique constraint
on this column, as it is not present in the class definition.
How to solve this problem ?

--
Guillaume Rousse
*******************************************
Iremia -Universit� de la R�union
15 avenue Ren� Cassin, BP 7151
97715 Saint Denis, messagerie cedex 9
Tel:0262938287 Fax:0262938260 ICQ:10756815
Mail:Guillaume.Rousse@univ-reunion.fr

BRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
ARTHUR: What do you mean? An African or European swallow?


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

Предыдущее
От: Benkő Attila
Дата:
Сообщение: Support for national characters - Hungarian
Следующее
От: Patrick Welche
Дата:
Сообщение: Re: [GENERAL] can't seem to use index