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);
---(end of broadcast
On Wed, Sep 06, 2006 at 09:59:03AM +0200, Ivan Sergio Borgonovo wrote:
> You can write a xor function. At least in 7.4, that I'm currently using,
> there is no xor operator.
Ah, but there's is, but it's in disguise:
test=# select true <> true, true <> false, false <> true, false <> false;
?colu
On Wed, 6 Sep 2006 09:29:23 +0200
"Dawid Kuroczko" <[EMAIL PROTECTED]> wrote:
> On 9/6/06, George Pavlov <[EMAIL PROTECTED]> 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? I
On 9/6/06, George Pavlov <[EMAIL PROTECTED]> 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? I currently have:
create table f (
a int,
b int,
check (a + b is null),
check (coale
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? I currently have:
create table f (
a int,
b int,
check (a + b is null),
check (coalesce(a,b) is not null)
);
Is there a better way to do