Re: constraint -- one or the other column not null - Mailing list pgsql-general

From Wayne Conrad
Subject Re: constraint -- one or the other column not null
Date
Msg-id 20060906142112.GA2657@yagni.com
Whole thread Raw
In response to constraint -- one or the other column not null  ("George Pavlov" <gpavlov@mynewplace.com>)
List pgsql-general
On Wed, Sep 06, 2006 at 12:04:18AM -0700, George Pavlov wrote:
> I have two columns, both individually nullable, but a row needs to have
> a value in one or the other. What is the best way to implement the
> constraints?

check (a is null != b is null);

pgsql-general by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Estimate on gborg rescue?
Next
From: Tom Lane
Date:
Subject: Re: Postgres 8.1.4 sanity_check failed on SuSE 8.2