postgresql update select inner join