title: Select from a table variable
body: <p>I am trying to save the result of a <code>SELECT</code> query, pass it, and reuse it in another PL/pgSQL function:</p>
  
  <pre><code>DECLARE
    table_holder my_table; --the type of table_holder is my_table;
    result text;
  
  BEGIN
    SELECT * INTO table_holder FROM table_holder ;
  
    result = another_function(table_holder);  
    return result;
  END
  </code></pre>
  
  <p>The code for <code>another_function(table_holder my_table)</code>, respectively:</p>
  
  <pre><code>BEGIN
  
    RETURN QUERY
    SELECT col FROM table_holder where id = 1;
  
  END
  </code></pre>
  
  <p>Is it possible to run a <code>SELECT</code> query on a variable? If not, is there a way to get around this limitation?</p>
  
  <p>I am using PostgreSQL 9.2.</p>