postgresql update join two tables