title: Casting to a nested type in Postgres
body: <p>Is it possible to cast a value to an Array or a Struct with the normal <code>cast</code> syntax? For example, similar to how I can do:</p>
  <pre><code>SELECT 
      '1'::INT, CAST('1' AS INT)
      CAST('1' AS INT)
  </code></pre>
  <p>Am I able to do something like:</p>
  <pre><code>SELECT '[1,2,3]'::ARAY
  </code></pre>
  <p>Or:</p>
  <pre><code>SELECT '{&quot;x&quot;:1}'::RECORD
  </code></pre>
  <p>To cast something to a nested - and not pre-specified with a previously-created custom <code>TYPE</code>?</p>
  <p>As an example for comparison, here is using BigQuery:</p>
  <pre><code>select 
    CAST(([1,2,3],[4,5,6]) AS STRUCT&lt;ARRAY&lt;INT64&gt;, ARRAY&lt;INT64&gt;&gt;) AS a, 
    CAST([1,2,3] AS ARRAY&lt;INT64&gt;) AS b
  </code></pre>
  <p><a href="https://i.stack.imgur.com/wKnfL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wKnfL.png" alt="enter image description here" /></a></p>