Add has_foreign_table() and hasnt_foreign_table().