title: Count for all values of enum in PostgreSQL
body: <p>I have a table called <code>users</code>, which has the following columns:</p>
  
  <pre><code>id: INT NOT NULL
  face: face_type
  </code></pre>
  
  <p><code>face_type</code> is an ENUM type that has the following values: <code>'square'</code>, <code>'round'</code> and <code>'triangle'</code>.</p>
  
  <p>And I have another table called <code>houses</code>, which has the following columns:</p>
  
  <pre><code>id: INT NOT NULL
  user_id: INT NOT NULL
  </code></pre>
  
  <p>Now, I want to get all the houses grouped by the different type of face types. So, what I have so far is this:</p>
  
  <pre><code>SELECT users.face_type, COUNT(*)
  FROM users
  LEFT JOIN houses ON houses.user_id = users.id
  GROUP BY users.face_type
  </code></pre>
  
  <p>The problem is that I also want to get rows for <code>face_type</code> which none of the users have, as well as a result for NULL face_type. So, for example, if I have the following data:</p>
  
  <pre><code>users (id, face_type)
  
  1, 'round'
  2, 'triangle'
  
  houses (id, user_id)
  1, 1
  2, 1
  3, 2
  </code></pre>
  
  <p>I would expect the result to be:</p>
  
  <pre><code>face_type, count
  'round'          2
  'triangle'       1
  'square'         0
  null             0
  </code></pre>
  
  <p>I know how to get all the potential values of the <code>face_type</code> ENUM, by doing  :</p>
  
  <pre><code>SELECT unnest(enum_range(NULL::face_type)) AS face_types;
  </code></pre>
  
  <p>But I don't know how to use that to count all potential face types in the aggregate, as well as also calculating for NULL face types.</p>