Re: My honours project - databases using dynamically attached entity-properties

From: Richard Huxton <dev(at)archonet(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Sean Utt <sean(at)strateja(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>, josh(at)agliodbs(dot)com, pgsql-hackers(at)postgresql(dot)org, Edward(dot)Stanley(at)mcs(dot)vuw(dot)ac(dot)nz
Subject: Re: My honours project - databases using dynamically attached entity-properties
Date: 2007-03-13 14:21:37
Message-ID: 45F6B371.7040606@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter wrote:
> On Tue, Mar 13, 2007 at 09:31:45AM +0000, Richard Huxton wrote:
>> * Another good example is the "questionnaire".
>
> With all due respect, this is a solved problem *without EAV or
> run-time DDL*. The URL below has one excellent approach to this.
>
> <http://www.varlena.com/GeneralBits/110.php>

Which broadly speaking was the solution I used for my questionnaire,
except I had a restricted set of types so basically just coerced them to
text and side-stepped the inheritance issue. To the extent that it's
dynamic, it's still just EAV though.

It doesn't remove the need for run-time DDL if you allow users to add
their own questions. If I add a "National Insurance No." (Social
security No) then either it's:
1. Plain text, and can take clearly invalid codes
2. A user-space construct with regexp matches etc (basically recreating DDL)
3. DDL.

And as the example says, you need to create the table types in advance.
If you want to add e.g. "Work History" (employer, from_date, to_date) to
a questionnaire then you'll need dynamic DDL (of form #2 or #3 above).

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mario Weilguni 2007-03-13 14:24:01 Re: Bug in UTF8-Validation Code?
Previous Message Andrew Dunstan 2007-03-13 14:12:55 Re: Bug in UTF8-Validation Code?