Parially complete code to make NULL/NOT NULL constraints work with outer joins.