title: A column definition list is required for functions returning "record" in Postgresql
body: <p>In the Below Postgresql Function i am trying to get results from 2 different tables but it throws error ERROR: 42601: a column definition list is required for functions returning "record".Can anyone please help me.</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION load_page_record(IN _session INT) RETURNS RECORD AS
  $$
  DECLARE r1 RECORD;
  DECLARE r2 RECORD;
  DECLARE RESULT RECORD;
  BEGIN
      SELECT array_agg(sq.*) AS arr INTO r1
      FROM (SELECT user_id, user_name 
            FROM "user" 
            ) sq;
      SELECT array_agg(sq.*) AS arr INTO r2
      FROM (SELECT client_id, client_name 
            FROM "clients"
            ) sq;
  
      SELECT r1.arr, r2.arr INTO RESULT;
      RETURN RESULT;
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>