database constraints

From: Ben <bench(at)silentmedia(dot)com>
To: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: database constraints
Date: 2004-10-06 15:23:11
Message-ID: A27C13B0-17AB-11D9-8A0D-000A95BF2A8C@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

If I have have the table:

create table foo
(
a int references bar(id),
b int references baz(id)
)

... how do I make sure one and only one of the columns a and b are
non-null? Is it even reasonable?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2004-10-06 15:30:13 Re: Random not so random
Previous Message Tom Lane 2004-10-06 15:10:30 Re: Cache lookup failed for relation, when trying to DROP TABLE.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-10-06 15:32:49 Re: [pgsql-hackers-win32] win32 tablespace handing
Previous Message Reini Urban 2004-10-06 15:15:22 Re: [pgsql-hackers-win32] win32 tablespace handing