i have table like : table : a a_id, b_id, c_id, type, created_at i should join a with table b or c for each row, just one of the b_id or c_id is filled(according to type) if b => a should join with b c => a should join with c how can i do this in postgresql