X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7A54CD6DAA for ; Fri, 14 Oct 2005 06:17:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24012-05 for ; Fri, 14 Oct 2005 09:17:49 +0000 (GMT) Received: from mallaury.nerim.net (smtp-105-friday.noc.nerim.net [62.4.17.105]) by svr1.postgresql.org (Postfix) with ESMTP id 8472ED8225 for ; Fri, 14 Oct 2005 06:17:50 -0300 (ADT) Received: from jobmare.clarisys.lan (claridsl512.net1.nerim.net [213.41.148.137]) by mallaury.nerim.net (Postfix) with ESMTP id 52F5C4F3EB; Fri, 14 Oct 2005 11:17:45 +0200 (CEST) Received: from day by jobmare.clarisys.lan with local (Exim 4.52) id 1EQLhu-0007Oc-2E; Fri, 14 Oct 2005 11:18:30 +0200 Date: Fri, 14 Oct 2005 11:18:30 +0200 From: David Pradier To: pgsql-sql@postgresql.org Subject: Design problemi : using the same primary keys for inherited objects. Message-ID: <20051014091829.GB19930@clarisys.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 required=5 tests=[FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/155 X-Sequence-Number: 23008 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