Design problemi : using the same primary keys for inherited objects.

From: David Pradier <david(dot)pradier(at)clarisys(dot)fr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Design problemi : using the same primary keys for inherited objects.
Date: 2005-10-14 09:18:30
Message-ID: 20051014091829.GB19930@clarisys.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi everybody,

i've got a strange design question to ask you.
It's something I couldn't answer to while feeling confusely it was an
absolutely BAD thing to do.

For our application, we have developed our own framework which sits on
top of PostgreSQL. It uses object programming and implements heritage.
Inherited objects use heritage links in the framework and relation links
in PostgreSQL (Search me why it doesn't use heritage in PostgreSQL !?).

I've got this thing :
An object A inherits from an object B, which inherits from a object C,
which inherits from an object D.
One of my colleagues proposed that we don't use serial (integer +
sequence) primary keys for these objects, but that we use the very same
integer primary keys.
That is : the instance A would use the id 12343, and the instance B the
same id 12343 and the instance C the same id 12343 and the D instance the
same id 12343.

It's possible as two instances of an object never inherit from a same
instance of another object.

The id seems to me absolutely bad, but I wouldn't know how to phrase
why.

Any suggestion ?

Thanks in advance,
David.

--
David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / open-source

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2005-10-14 09:39:47 Re: copy table
Previous Message Shavonne Marietta Wijesinghe 2005-10-14 08:44:13 copy table