Hilary Forbes <hforbes(at)dmr(dot)co(dot)uk> writes:
> I need to set the value of a field in table A to a value in table B depending on the existence of the record in table B. So what I have done is
> UPDATE tableA set a.val1=b.somefield FROM tableA a, tableB b WHERE a.key1=b.key1;
You've written an unconstrained join to a second copy of tableA.
regards, tom lane