Postgresql Update Using Multiple Tables