title: Return multiple rows from plpgsql function
body: <p>I have the below function:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION function1() RETURNS TABLE(foo1 VARCHAR, foo2 VARCHAR) AS $$
      BEGIN
      RETURN QUERY SELECT e.col1, e.col2 FROM my_table e;
      END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>It returns something like this:</p>
  
  <pre><code>function1
  record
  |--------------|
  (a,b)
  (c,d)
  </code></pre>
  
  <p>But I'm expecting a result analog to a query like this:</p>
  
  <p>SELECT e.col1, e.col2 FROM my_table e;</p>
  
  <pre><code>  col1  col2
  |-----|-----|
     a     b
     c     d
  </code></pre>
  
  <p>Because I want to execute the function a get the separates columns values in a java resultSet and iterate accros them. Thanks! </p>