Re: mutually exclusive subtypes

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: "Olinga K(dot) Abbott" <olingaa(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: mutually exclusive subtypes
Date: 2006-04-13 17:05:55
Message-ID: 20060413170556.41760.qmail@web31804.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

The easiest way might be to use table inheritance.

--- "Olinga K. Abbott" <olingaa(at)yahoo(dot)com> wrote:

> Let's say I have the following contrived schema:
>
> TRANSPORTATION_MODE
> mode_ID serial
> model_number text
>
> AIRPLANE
> mode_ID int FK
> operational_ceiling nt
>
> AUTOMOBILE
> mode_ID int FK
> cruising range int
>
>
> Of course, being an airplane and being an automobile are mutually exclusive.
> How does one program the mutual exclusivity in PostgreSQL? I've studied using
> check contraints, triggers, and rules, but I'm not finding any obvious way to
> program this.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ennio-Sr 2006-04-13 18:05:44 Colors/bold chars in a select?
Previous Message Daniel T. Staal 2006-04-13 15:23:28 Re: mutually exclusive subtypes