title: Postgres function: return multiple tables
body: <p>Is it possible to return several result sets of different types from postgres function?</p>
  
  <p>Something like:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION getUserById()
  RETURNS setof ???
  AS
  $$
  BEGIN
  
  return query select id, name /* and other columns */ from users where id = 1;
  return query select id, phone_number from user_phones where user_id = 1
  
  END
  $$
  LANGUAGE plpgsql;
  </code></pre>
  
  <p>I don't want to use joins because several phones for user are possible. Also it would be great to avoid using cursors.
  It's possible in MS SQL and I want to do the same thing in postgres.</p>