XOR logical operator - Mailing list pgsql-general

From Nagib Abi Fadel
Subject XOR logical operator
Date
Msg-id 20031017080448.23789.qmail@web21403.mail.yahoo.com
Whole thread Raw
Responses Re: XOR logical operator  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Re: XOR logical operator  (Peter Childs <blue.dragon@blueyonder.co.uk>)
Re: XOR logical operator  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-general
Is there a XOR logical operator in Postgresql, or a
function for XOR ??

I only found in the docs a Binary XOR (#).

I need to do the following checkup:
(field1 is NULL XOR field2 is NULL XOR filed3 is NULL)

i can't right it like this:
(
(field1 is NUll or field2 is NUll)
and (field1 is NUll or field3 is NUll)
and (field2 is NUll or field3 is NUll)
)

But if i have alot of fields :
field1,field2,...,field5
... this will take a hell of a time
I can write a function F1 that does the following:
if a field is NULL it will return 1
else it will return 0

then i can do:
(F1(field1) # F1(field2) # F1(field3) ...)


but i just wanted to see if XOR already exists ...



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

pgsql-general by date:

Previous
From: Sharon Cowling
Date:
Subject: Disabling referential integrity
Next
From: Pavel Stehule
Date:
Subject: Re: XOR logical operator