if ( ISNULL(new.a) AND ISNULL(new.b) ){ RAISE NOTICE "blah blah"; }
I work with PHP a lot, just a little plpgsql, so, the grammar may be wrong above.
Ben <[EMAIL PROTECTED]> wrote:
<quote --------------------------------------------------------------->
If I have have the table:
create table foo ( a int references bar(id), b int references baz(id) )
... how do I make sure one and only one of the columns a and b are non-null? Is it even reasonable?
</quote -------------------------------------------------------------->
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend