title: PostgreSQL generate_series with WHERE clause
body: <p>I'm having an issue generating a series of dates and then returning the <code>COUNT</code> of rows matching that each date in the series.</p>
  
  <pre><code>SELECT generate_series(current_date - interval '30 days', current_date, '1 day':: interval) AS i, COUNT(*)
  FROM download
  WHERE product_uuid = 'someUUID'
  AND created_at = i
  GROUP BY created_at::date
  ORDER BY created_at::date ASC
  </code></pre>
  
  <p>I want the output to be the number of rows that match the current date in the series.</p>
  
  <pre><code>05-05-2018, 35
  05-06-2018, 23
  05-07-2018, 0
  05-08-2018, 10
  ...
  </code></pre>
  
  <p>The schema has the following columns: <code>id</code>, <code>product_uuid</code>, <code>created_at</code>. Any help would be greatly appreciated. I can add more detail if needed.</p>