select * from foo where text='hello0' and ( (bar is not null and (bar<->point(0,0) ) < 1000) or ( bar2 is not null and (bar2<->point(0,0)) < 1000)); 
select * from foo where text='hello1' and ( (bar is not null and (bar<->point(0,0) ) < 1000) or ( bar2 is not null and (bar2<->point(0,0)) < 1000)); 
select * from foo where text='hello2' and ( (bar is not null and (bar<->point(0,0) ) < 1000) or ( bar2 is not null and (bar2<->point(0,0)) < 1000)); 
