Received: from jupiter.hub.org (jupiter.hub.org [64.49.215.5]) by postgresql.org (Postfix) with ESMTP id 64785475884 for ; Mon, 4 Mar 2002 07:03:43 -0500 (EST) Received: (from news@localhost) by jupiter.hub.org (8.11.6/8.11.6) id g24BeAq79530 for pgsql-sql@postgresql.org; Mon, 4 Mar 2002 05:40:10 -0600 (CST) (envelope-from news) From: "Andreas F." X-Newsgroups: comp.databases.postgresql.sql Subject: confusing inheritance Date: Mon, 04 Mar 2002 12:46:46 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 51 Message-ID: <3C835EA6.8010409@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: news@hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:0.9.8) Gecko/20020204 X-Accept-Language: de-at, de, en, en-us To: pgsql-sql@postgresql.org X-Archive-Number: 200203/83 X-Sequence-Number: 6964 I'm trying to get going with this objekt oriented concept but managed to get confused right from the start. Basically I know what it's all about with OO from programming languages but look: I started pgAdmin and entered something like TABLE myObjects ( ObjectID int4 PRIMARY KEY, createdOn timestamp, createdByUserID int4 ) then TABLE myTerminatedObjects ( validFrom timestamp, validUntil timestamp ) INHERITS myObjects I inserted an object with ObjectID = 0 into myOjects. Then I inserted a record in myTerminatedObjects again with ObjectID=0 since I supposed that myTerm... only inherited the structure of myObjects. As expected myTerm... had one record. But myObjects held 2 records both with 0 in the ObjectID column, which I thought to be impossible because it is the primary key of myObjects. Obviously myTerminatedObjects stores it's values of inherited fields in the tablespace of myObjects breaking myObjects integrity without PostgreSQL complainig about. Am I right ? And myTerm... inherits the field "ObjectID" but not in the function as primary key so it has no key at all ? At least MS-Access 2K told me so. May someone give me a pointer to whats going on, please ? ... Andreas System: Win 2K PostgreSQL 7.2.2 as service Access 2K as client pgAdminII 1.2.0 as client