Re: what about uniqueness of inherited primary keys

Поиск
Список
Период
Сортировка
От Andreas
Тема Re: what about uniqueness of inherited primary keys
Дата
Msg-id 3FF04421.3090906@gmx.net
обсуждение исходный текст
Ответ на Re: what about uniqueness of inherited primary keys  (Seastian Böck <sebastianboeck@freenet.de>)
Ответы Re: what about uniqueness of inherited primary keys
Список pgsql-general
Seastian Böck wrote:

> for primary keys there is a simple (and at least working for me)
> solution as long as you can use the SERIAL type for your primary
> key.
> [...]
> Now the id column gets merged and you should have the desired
> behaviour.
>
> If you want objects.id to get referenced by other tables you have
> to work around with triggers and an extra table. For persons.id
> everything is working fine.
>
> This solution (workaround) is only working as long you don't
> insert id-values without updating the corresponding sequence.


Hello Se(b)astian
-- you left out the 'b' in your e-mail setup   ;)

right, your proposal does in a way behave like I wanted. Though the idea
of integrity control by the db-server is still not there for parent
id-colomns. Every user or application could mess up the primary key of
the inherited table. That spoils a bit of the oo-approach, I fear.

It wouldn't be that bad, if the table contents weren't merged in SELECTs.

Probaply one could do some trigger-magic to check the inserted id
against an id-pool in another table.
If one knew anything about triggers that is ... well ... miles to go
before I sleep ...

Thanks
Andreas


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

Предыдущее
От: Ericson Smith
Дата:
Сообщение: Re: Is my MySQL Gaining ?
Следующее
От: lis
Дата:
Сообщение: case insensetive UTF-8