title: Returning from a function with OUT parameter
body: <p>I have an error, but I don't know what the problem is.</p>
  
  <p>I want execute a function and return a value from a column filled in by the column default, a sequence - the equivalent of <code>currval(sequence)</code>.</p>
  
  <p>I use:<br>
  PostgreSQL 9.0<br>
  pgAdmin III</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION name_function(in param_1 character varying
                                        , out param_2 bigint)
    AS
  $$
  BEGIN
      INSERT INTO table (collumn_seq,param_1) VALUES (DEFAULT,param_1)
      returning collumn_seq;
  --where:collumn_seq reference a collumn serial..
  END;
  $$
    LANGUAGE plpgsql VOLATILE;
  </code></pre>
  
  <p>I can create the function without error but when trying to execute, the following error is returned:</p>
  
  <blockquote>
  <pre><code>SELECT name_function('GHGHGH');
  
  ERROR: The query has no destination for result data
  </code></pre>
  </blockquote>