two not null columns

From: Garry Saddington <garry(at)schoolteachers(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: two not null columns
Date: 2008-04-14 16:32:52
Message-ID: 200804141732.53343.garry@schoolteachers.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How would I write a table check constraint to make sure that two columns don't
both have nulls at the same time.
The following doesn't do it because it because it does not allow one column to
be null while the other holds data?

check(teachgroup is not null AND set is not null)

regards
garry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2008-04-14 16:44:40 Re: two not null columns
Previous Message tosbalok@gmail.com 2008-04-14 16:30:11 Unacceptable postgres performance vs. Microsoft sqlserver