Skip site navigation (1) Skip section navigation (2)

mutually exclusive subtypes

From: "Olinga K(dot) Abbott" <olingaa(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: mutually exclusive subtypes
Date: 2006-04-12 21:21:32
Message-ID: 20060412212132.8626.qmail@web31802.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
Let's say I have the following contrived schema:

TRANSPORTATION_MODE
modeID serial
model_number text

AIRPLANE
airplaneID serial
operational_ceiling int
modeID int FK

AUTOMOBILE
automobileID serial
cruising range int
modeID int FK

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.

pgsql-novice by date

Next:From: DavidDate: 2006-04-13 00:19:26
Subject: In plpgsql: difference between := and =
Previous:From: E. Matthew FinninDate: 2006-04-12 18:52:37
Subject: The COPY command and csv files

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group