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

One or Both Foregin Keys

From: Dennis Gearon <gearond(at)fireserve(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: One or Both Foregin Keys
Date: 2004-04-30 23:34:07
Message-ID: 4092E26F.2070302@fireserve.net (view raw or flat)
Thread:
Lists: pgsql-general
I am working on a design where a location for something can have:

    Fully qualified address with even building names, room numbers, and 
booth numbers.
**-OR-**
    GPS location
**-OR-**
    Both

Other than triggers, is there a way to enforce this using tables and 
primary keys?

I imagine an address table, and then
 
either a some sort of intermediate table,  in a one to many 
relationship, GPS to Addresses,
or the correct columns in the address table.

Either way, I don't see a normal way to enforce EITHER or BOTH without a 
trigger.

Thanks in Advance.

Responses

pgsql-general by date

Next:From: Sean ShannyDate: 2004-05-01 00:08:12
Subject: Re: "out of memory" error
Previous:From: Rachel McConnellDate: 2004-04-30 22:31:05
Subject: "out of memory" error

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