title: PostgreSQL trigger and stored procedure not kicking in
body: <p>My goal is to compute and persist a certain value before an update happens to a row in my table.</p>
  
  <p>I created the trigger and the function, I don't get any errors but the function doesn't seem to be kicking in. Where am I going wrong? </p>
  
  <p>The procedure </p>
  
  <pre><code>CREATE or REPLACE FUNCTION foo() returns trigger as
    $BODY$
    DECLARE
    BEGIN
      NEW.geomtry := st_transform(st_pointfromtext('POINT(' || NEW.af_lon || ' ' || NEW.af_lat || ')', 4326), 32643);
      return NEW;
    END;
    $BODY$
  language plpgsql;
  </code></pre>
  
  <p>The trigger to trigger the method before an update happens</p>
  
  <pre><code>CREATE TRIGGER foo_trigger BEFORE UPDATE ON foo_table FOR EACH ROW EXECUTE PROCEDURE foo();
  </code></pre>