Re: Critique needed for contact-DB draft - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: Critique needed for contact-DB draft
Date
Msg-id 20040715183503.GB18875@wolff.to
Whole thread Raw
In response to Re: Critique needed for contact-DB draft  ("Felix E. Klee" <felix.klee@inka.de>)
List pgsql-novice
On Thu, Jul 15, 2004 at 16:25:54 +0200,
  "Felix E. Klee" <felix.klee@inka.de> wrote:
> The new draft:
>
> "Major" tables:
>     ORGANIZATIONS:
>     contact_id, offers, demands, description, type (person|non-person),
>     type_id (a person_id or a non-person_id)

You probably want to have two separate type_id fields and use constraints
to enforce exactly one of them being NULL. They should both REFERENCE the
appropiate table. This makes the type field redundant, but if you find it
simpler to have it then adjust the above constraints to make it consistant
with which type_id field is not NULL.

>
>     PERSONS:
>     person_id, surname, given_names, pseudonyms, prefix, suffix, sex (M|F)
>
>     NON-PERSONS:
>     non-person_id, name, type (company|non-profit|...)

pgsql-novice by date:

Previous
From: "Felix E. Klee"
Date:
Subject: Re: Critique needed for contact-DB draft
Next
From: "M. Bastin"
Date:
Subject: Re: Extended query: prepared statements list?