I have the following simple SQL update:
update t2 set col = 2
from t2, t1
where t2.id = t1.id
and t1.name = 'test';
But all the rows in t2 are updated! i.e. not just the one with the id where name is 'test', how do I achieve this in Postgres?