Re: My honours project - databases using dynamically attached entity-properties - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: My honours project - databases using dynamically attached entity-properties
Date
Msg-id 45F813E0.6010503@commandprompt.com
Whole thread Raw
In response to Re: My honours project - databases using dynamically attached entity-properties  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: My honours project - databases using dynamically attached entity-properties  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Gregory Stark wrote:
> "David Fetter" <david@fetter.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/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Daylight Saving Time question PostgreSQL 8.1.4
Next
From: Gregory Stark
Date:
Subject: Re: My honours project - databases using dynamically attached entity-properties