How to update a point table when a polygon table is modified
Would make a comment, but don't have enough reputation, sorry. 

Shouldn't  NEW and OLD be B and ? B_new or something like this? Where is the new geometry stored to make the ST_Within check? 

If I missed something and you want to compare geometries as in NEW.geom &lt;&gt; OLD.geom, consider ST_Equals or ST_OrderingEquals like ST_OrderingEquals(NEW.geom, OLD.geom) = 0