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

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

Gregory Stark wrote:
> "David Fetter" <david(at)fetter(dot)org> writes:
>
>> CREATE TABLE symptom (
>> symptom_id SERIAL PRIMARY KEY, /* See above. */
>> ...
>> );
>>
>> CREATE TABLE patient_presents_with (
>> patient_id INTEGER NOT NULL REFERENCES patient(patient_id),
>> symptom_id INTEGER NOT NULL REFERENCES symptom(symptom_id),
>> UNIQUE(patient_id, symptom_id)
>> );
>
> I'm just glad I don't have your doctor. I hope mine doesn't think symptoms are
> all boolean values.

With a unique across (patient_id,symptom_id) you could have a single
patient with as many unique symptoms as could be listed.

Joshua D. Drake

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-03-14 15:25:48 Re: My honours project - databases using dynamically attached entity-properties
Previous Message Joshua D. Drake 2007-03-14 15:21:53 Re: [PATCHES] Bitmapscan changes