title: Return type for function/triggers?
body: <p>So, after finally getting a bit knowledge about triggers and functions in postgresql, I can't seem to find out whats wrong here:</p>
  
  <p>I create a function for a trigger:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION upd_totaal_telling()
  RETURNS trigger AS
  $BODY$
  BEGIN
  UPDATE totaal_telling
  SET telling_getal = (SELECT SUM(pers_salaris) FROM personeel)
  RETURNING telling_getal;
  END;
  $BODY$ 
  LANGUAGE PLPGSQL;
  </code></pre>
  
  <p>Then I create the trigger for it:</p>
  
  <pre><code>CREATE TRIGGER trig_totaal_telling
  AFTER INSERT OR UPDATE ON personeel
  FOR EACH ROW
  EXECUTE PROCEDURE upd_totaal_telling();
  </code></pre>
  
  <p>But when I try to insert a value into table, I get this error:</p>
  
  <blockquote>
    <p>ERROR:  query has no destination for result data CONTEXT:  PL/pgSQL
    function upd_totaal_telling() line 3 at SQL statement
    ********** Error **********</p>
    
    <p>ERROR: query has no destination for result data SQL state: 42601
    Context: PL/pgSQL function upd_totaal_telling() line 3 at SQL
    statement</p>
  </blockquote>