Storing properties in a logical way.

From: "Daniel M(dot)" <xt(at)nm(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Storing properties in a logical way.
Date: 2004-09-06 03:42:47
Message-ID: 413BDCB7.10009@nm.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Elphick 2004-09-06 06:24:48 Re: Full access to a DB with a second user?
Previous Message Tom Lane 2004-09-06 02:13:57 Re: INFORMATION_SCHEMA and foreign keys