title: Can ANY check for IS NOT NULL for an Array in PostgreSQL?
body: <p>I have a query like this to group by one column and check if any of the records have data in a different column:</p>
  
  <pre><code>SELECT
    bar,
    MAX(CASE WHEN baz IS NOT NULL THEN 1 ELSE 0 END)::BOOLEAN as baz_has_data
  FROM
    foos
  GROUP BY
    bar
  </code></pre>
  
  <p>I feel like that's a little bit cryptic, and thought using <code>ANY</code> and <code>ARRAY_AGG</code> would be clearer. Unfortunately I can't find any examples that include both an <code>IS NOT NULL</code> and an <code>ANY(ARRAY_AGG ...)</code>. Is this possible?</p>