On Wed, Oct 06, 2004 at 08:35:21 -0700,
sklassen@commandprompt.com wrote:
> * Ben <bench@silentmedia.com> [2004-10-06 08:23:11 -0700]:
>
> ALTER TABLE foo ADD CONSTRAINT must_have_a_or_b CHECK (a::int IS NULL
> AND b::int IS NOT NULL OR a::int IS NOT NULL AND b::int IS NULL);
A simpler constraint is:
check (a is null <> b is null);