X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B814A9DC9B6 for ; Sun, 12 Mar 2006 14:15:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56784-09 for ; Sun, 12 Mar 2006 14:15:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hosting33.com (hosting33.com [203.194.209.173]) by postgresql.org (Postfix) with ESMTP id 2B19A9DC990 for ; Sun, 12 Mar 2006 14:15:47 -0400 (AST) Received: (qmail 10332 invoked by uid 504); 12 Mar 2006 18:15:47 -0000 Received: from unknown (HELO paulsen.homeip.net) (70.112.127.158) by hosting33.com with SMTP; 12 Mar 2006 18:15:47 -0000 From: Robert Paulsen To: chester c young Subject: Re: Question re: relational technique Date: Sun, 12 Mar 2006 12:15:45 -0600 User-Agent: KMail/1.9.1 Cc: pgsql-sql@postgresql.org References: <20060312172903.6034.qmail@web54305.mail.yahoo.com> In-Reply-To: <20060312172903.6034.qmail@web54305.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603121215.46141.robert@paulsenonline.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.201 required=5 tests=[AWL=0.201] X-Spam-Score: 0.201 X-Spam-Level: X-Archive-Number: 200603/177 X-Sequence-Number: 24523 On Sunday 12 March 2006 11:29, chester c young wrote: > --- Robert Paulsen wrote: > > One problem with the above is that the list of attributes is fixed. I > > am looking for a way to assign new, previously undefined, attributes > > to > > > items without changing the table structure. Is it ever appropriate to > > do > > > the following? > > ... > > There are two ways for extending tables, one static and one dynamic. > > Your scheme is dynamic. You will have problems with typing and > performance. What you really want is to be able to list more > attributes, similar to attributes attached to a tag in html. > > If you want a base table that has, under different specified > conditions, extra attributes, there are better techniques. IMHO the > best solution is, for each condition, create a table containing the > primary table's id plus the extra attributes; then join that to the > base table So, to be sure I understand, something like ... item item_id int name char cond_one cond_one_id int cond_one_descr char item_id int attribute_a char attribute_b int cond_two cond_two_id int cond_two_descr char item_id int attribute_c bool attribute_d date etc... This still requires me to modify the overall database structure but not the original item table. As my reward :) I get to use any type I choose for each new attribute.