title: how to extract date from JSON data type column in Postgres
body: <p>I have a column <code>open_houses</code> that's JSON data type and it looks like this:</p>
  
  <pre><code>open_houses
  [{"Date": "2017-08-13", "ToTime": "4:00PM", "FromTime": "2:00PM"}]
  [{"Date": "2017-08-12", "ToTime": "3:00PM", "FromTime": "1:00PM"}]
  [{"Date": "2017-08-12", "ToTime": "4:00PM", "FromTime": "2:00PM"}]
  [{"Date": "2017-08-13", "ToTime": "3:00PM", "FromTime": "1:00PM"}]
  </code></pre>
  
  <p>When I try to extract 'Date' from this column I get an error - </p>
  
  <pre><code>SELECT ...
  FROM   prod.vw_listing
  WHERE  ...
         ...
         AND open_houses[1] -&gt; 'Date'::DATE &gt;= current_date;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>cannot subscript type jsonb because it is not an array
  </code></pre>