Postgresql Update Query With Subquery