title: How to return ARRAY of multiple fields from subquery
body: <p>I need top level query that returns array of subquery that returns multiple fields. Simple <code>select array(select ...);</code> does not work due to following error:</p>
  
  <blockquote>
    <p>subquery must return only one column</p>
  </blockquote>
  
  <p>Part of query:</p>
  
  <pre><code>(SELECT array(SELECT
                  logs_log.message -&gt; 'slot_date',
                  logs_log.message -&gt; 'start_time',
                  logs_log.message -&gt; 'end_time',
                  logs_log.message -&gt; 'source',
                  logs_log.message -&gt; 'phone_number'
                FROM
                  logs_log
                WHERE
                  logs_log.message -&gt;&gt; 'phone_number' = leads_lead.phone_number))
    AS previous_appointments
  </code></pre>
  
  <p>Any ideas how can I achieve result I described above?</p>
  
  <p>logs_log table:</p>
  
  <pre><code>id, object_id, action_time, content_type_id, user_id, message
  28138, 0d36a20d-a251-41c3-ba7e-2d270004f4b1, 2017-01-27 06:48:06.550265+00, 18, 1, {"source": "driver_email", "end_time": "13:30:00", "slot_date": "0333-03-23", "start_time": "13:00:00", "phone_number": "1231231231"}
  28137, 0d074daa-0c77-4f96-b512-248cdfb9263b, 2017-01-24 21:31:16.140453+00, 18, 1, {"source": "driver_email", "end_time": "13:30:00", "slot_date": "3333-03-23", "start_time": "13:00:00", "phone_number": "9111111992"}
  </code></pre>
  
  <p>leads_lead table:</p>
  
  <pre><code>id, first_name, second_name, phone_number, city_id, source_id, external_id, attributes, created_at, ip_address, partner_id, tags
  ab99dbba-d339-407a-8e2d-c0ffd676213b,Денис,Антонов,7123123123,b3b62c53-6815-4898-b3b6-23a1196c1986,7ee38a21-32d0-4362-8519-0bc6e6ce37b8,20391438-4d19-48b3-aae0-8d1ab0d7ef93,"""{\""uuid\"":\""20392223-4d19-48b3-aae0-8d1ab0d7ef93\""}""",2016-11-07 17:30:00.583425+00,,,
  </code></pre>