title: How to exclude or remove NULL values from array and array_agg with PostgreSQL
body: <p>In the following request:</p>
  
  <pre><code>SELECT
    myid,
    min(name) AS name,
    array_agg(array[zip, city])) AS city
  FROM my_table
  WHERE name LIKE 'Doe'
  GROUP BY myid
  LIMIT 10
  </code></pre>
  
  <p>I get the following result:</p>
  
  <pre><code>+-------+------+-------------------+
  | myid  | name | city              |
  +-------+------+-------------------+
  | A123  | Doe  | {{69,"Groville"}} |
  | B456  | Doe  | {{NULL,NULL}}     |
  +-------+------+-------------------+
  </code></pre>
  
  <p>How can I get rid of the <code>NULL</code> values and get an empty field for <code>city</code> instead ?</p>
  
  <p>=== EDIT ===</p>
  
  <p>Replaced <code>(array_agg(name))[1] AS name</code> by <code>min(name) AS name</code> in the query, as suggested by @a_horse_with_no_name.</p>