Re: Why not many2one with pk array type

From: David Portas <REMOVE_BEFORE_REPLYING_dportas_at_acm.org>
Date: 29 Jan 2006 10:46:54 -0800
Message-ID: <1138560414.298211.221910_at_g44g2000cwa.googlegroups.com>


Sandy.Pittendrigh_at_gmail.com wrote:
> This leads to a question.
> One way to model many to one is for the attacher
> table to hold a foreign key to the attachee table.
>
> Why couldn't some relational database support
> a new data type, which would be an array of
> numerical foreign keys?
>

No reason in principle why you can't have an array type column in an RDBMS. Your suggestion has some obvious disadvantages however. Relational operators operate on relations not arrays so manipulating an array structure as if it were a set of foreign keys would add an extra level of complexity to extract and manipulate the data from the array. Relation-valued attributes are perhaps a more natural alternative - such as supported by Tutorial D's GROUP, UNGROUP operators.

> Why do that? Automated mapping of GUI components to
> schema is easier when the schema is tree-like....where
> a program can start at the top of a structure and follow
> downward links to all the related data.

  • Object-Relational impedance mismatch. Which is mostly about the defects of current products and technologies rather than theoretical constraints.

> It would make relations look more like XML.

Yup. Oh dear...

-- 
David Portas
Received on Sun Jan 29 2006 - 19:46:54 CET

Original text of this message