title: Postgres trigger to only execute procedure when NEW.column = true
body: <p>Using PostgreSQL - I'm trying to fire a procedure that runs a trigger only when the <code>NEW</code> (inserted or updated) row has the <code>is_default</code> column value set to <code>boolean true</code>.</p>
  
  <p>This is what I've tried but I get a syntax error on my <code>WHEN</code> line:</p>
  
  <pre><code>CREATE TRIGGER trigger_price_group_default_price_handler
      BEFORE UPDATE OR INSERT
      ON price_groups
      WHEN (NEW.is_default = true)
      EXECUTE PROCEDURE clear_default_price_group();
  </code></pre>
  
  <p>Any ideas?</p>