CREATE OR REPLACE FUNCTION company_role_last_update() RETURNS trigger AS '
 BEGIN
  UPDATE object SET last_updated = now() WHERE objectid = new.targetid;
  RETURN NULL;
 END
' LANGUAGE plpgsql;

CREATE TRIGGER file_object_last_update_trigger AFTER INSERT OR UPDATE OF targetid ON company_role FOR EACH ROW EXECUTE PROCEDURE company_role_last_update();

