>Michael Fuhr <mike@fuhr.org> wrote on 01/25/2006 10:25:38 AM: > In 8.1, and in earlier versions if you create a cast from boolean > to integer, you could do this: > > ALTER TABLE event > ADD CONSTRAINT two_nulls_1 CHECK ( > (evenid1 IS NOT NULL)::int + > (evevid1 IS NOT NULL)::int + > (evreid1 IS NOT NULL)::int = 1); > > This works because the cast converts true to 1 and false to 0; > you're adding up the number of true expressions and requiring that > the sum equal 1 (i.e., that exactly one expression be true). > > -- > Michael Fuhr
I am in version 7.3 and it will not let me cast, I get message "ERROR: Cannot cast type boolean to integer". I will save this for when I upgrade.
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Margaret Gillon, IS Dept., Chromalloy Los Angeles, ext. 297