postgresql update query with inner join