title: Postgres how to return multiple columns in subquery
body: <p>I have a simple Postgres function:</p>
  <pre><code>CREATE OR REPLACE FUNCTION public.drivers_have_unsatisfied_documents()
   RETURNS driver_expiring_documents
  AS $function$
  DECLARE
      unsatified_documents driver_expiring_documents;
      expiring_doc driver_expiring_documents%rowtype;
      expiring_doc_driver_ids text[];
      expired_doc_driver_ids text[];
      expiring_date date;
      driver_id_arg text;
  BEGIN
      unsatified_documents := array(
      select expiration_date, driver_id from all_requirements_driver_documents where expiration_date &lt;= (now() + interval '1 month')::DATE and expiration_date &gt; (now() - interval '7 day')::DATE
      union
      select expiration_date, driver_id from all_requirements_vehicle_documents where expiration_date &lt;= (now() + interval '1 month')::DATE and expiration_date &gt; (now() - interval '7 day')::DATE
      );
      -- Do some more stuff, code intentionally removed ---
      return unsatified_documents;
  end;
  $function$ stable language 'plpgsql';
  </code></pre>
  <p>This is throws error saying</p>
  <blockquote>
  <p>multiple columns in subquery</p>
  </blockquote>
  <p>Can someone please help me fix it?</p>