X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6ADA4D1B89E for ; Tue, 19 Aug 2003 01:37:02 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 57948-08 for ; Tue, 19 Aug 2003 01:36:52 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id B9215D1B539 for ; Tue, 19 Aug 2003 01:36:50 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3525587; Mon, 18 Aug 2003 21:37:15 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: vwu98034@lycos.com, pgsql-sql@postgresql.org Subject: Re: Inheritance or no inheritance, there is a question Date: Mon, 18 Aug 2003 21:36:39 -0700 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308182136.39919.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/212 X-Sequence-Number: 14828 Vernon, > What is the best solution for this DB scheme problem? Have you considered not using inheritance? As a relational-SQL geek myself, I'm not keen on inheritance -- I feel it mucks up the relational model. Not everyone agrees with me, of course. Personally, I'd suggest the following structure: Profile A id Primary Key detail1 detail2 Profile B id Primary Key references Profile A ( ID ) detail 3 detail 4 detail 5 Profile Languages id not null references profile A ( ID ) language id primary key id, language id etc. In this way, Profile B is a child table with a 1:0-1 relationship with Profile A. Multi-value dependancies, like Languages, can be related to either the people who belong to the B group (and, by implication, the B group) or the people who belong to the A group only. Want the B group? SELECT A JOIN B Want the A group only? SELECT A EXCEPT B This is the "relational" way to approach the problem. -- Josh Berkus Aglio Database Solutions San Francisco