[postgresql] How to do an update + join in PostgreSQL?