title: CURRENT_DATE in postgresql triggers
body: <p>I have before insert trigger in postgres</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION add_requestdate() RETURNS TRIGGER AS $$
  DECLARE
  
  BEGIN
  
      new.requestdate := now();
  
      RETURN NEW;
  END;
  
  $$ LANGUAGE plpgsql;
  
  CREATE TRIGGER addrequestdate
  BEFORE INSERT ON requests FOR EACH ROW EXECUTE PROCEDURE add_requestdate ();
  </code></pre>
  
  <p>But it doesn't work! I have solution that works...</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION add_requestdate() RETURNS TRIGGER AS $$
  DECLARE
  
  BEGIN
  
      UPDATE requests SET requestdate=now() WHERE id=NEW.id;
  
      RETURN NEW;
  END;
  
  $$ LANGUAGE plpgsql;
  
  CREATE TRIGGER addrequestdate
  BEFORE INSERT ON requests FOR EACH ROW EXECUTE PROCEDURE add_requestdate ();
  </code></pre>
  
  <p>I have only one question. Why <code>new.requestdate := now();</code> doesn't work?</p>