title: PostgreSQL function return type
body: <p>I'm trying to define a function along the lines of:</p>
  
  <pre><code>CREATE FUNCTION myfunction(list_of_ids integer[]) RETURNS record AS $$
    SELECT a.col1, b.col2 FROM a, b WHERE col1 = ANY($1);
  $$ LANGUAGE 'sql'
  </code></pre>
  
  <p>However postgres doesn't seem happy with "record" as the return type, giving me this error when I try to execute the function:</p>
  
  <pre><code>ERROR:  a column definition list is required for functions returning "record"
  </code></pre>
  
  <p>Looking through the docs though I can't work out how to supply this column definition list.</p>