X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ED4215E48E2 for ; Sun, 5 Sep 2004 18:38:38 +0100 (BST) 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 23214-06 for ; Sun, 5 Sep 2004 17:38:33 +0000 (GMT) Received: from flock1.newmail.ru (morda.newmail.ru [212.48.140.150]) by svr1.postgresql.org (Postfix) with SMTP id 426925E48BF for ; Sun, 5 Sep 2004 18:38:31 +0100 (BST) Received: (qmail 3715 invoked from network); 5 Sep 2004 17:26:25 -0000 Received: from unknown (HELO ?192.168.0.133?) (xt@nm.ru@217.132.57.30) by smtpd.newmail.ru with SMTP; 5 Sep 2004 17:26:25 -0000 Message-ID: <413BDCB7.10009@nm.ru> Date: Sun, 05 Sep 2004 20:42:47 -0700 From: "Daniel M." Reply-To: xt@nm.ru User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Storing properties in a logical way. Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=4.2 tagged_above=0.0 required=5.0 tests=DATE_IN_FUTURE_06_12, RCVD_IN_DSBL, RCVD_IN_NJABL_PROXY X-Spam-Level: **** X-Archive-Number: 200409/31 X-Sequence-Number: 18877 Hello everybody, In a database there is a table with items, and each item can have 0 to n properties. The objective is to store information about items' properties in a mentioned database in a logical and an efficient way. Usually it is easily done by creating a validation table with a list of possible properties and then creating a n-to-n relationship by means of a linking table (hope I use the correct terms here). But after looking closely at the list of a possible properties, i found out that some of them depend on others. For example, if item is a PDF document, it can have an index. But a document can also have an index with links. Logically, a properties like 'index with links' don't belong to the verification table - they look like a kind of a composite field - 'index with links' is not a stand-alone property, but it also implies that an item also has an 'index' property. On the other hand, it is impossible to decouple 'index' from 'with links', because the second part won't have any meaning without the first part. How can such a kind of data be modeled in a logical way?