title: Select sum of an array column in PostgreSQL
body: <p>If I have the following table:</p>
  <pre><code>Table &quot;users&quot;
  Column          |       Type       | Modifiers 
  ---------------+------------------+-----------
    id            | integer          | 
    monthly_usage | real[]           | 
  </code></pre>
  <p>Where <code>monthly_usage</code> is an array of 12 numbers, i.e. <code>{1.2, 1.3, 6.2, 0.9,...}</code></p>
  <p>How can I select the sum of that column?</p>
  <p>Something along the lines of:</p>
  <p><code>SELECT id, sum(monthly_usage) as total_usage from users;</code></p>
  <p>Which obviously doesn't work.</p>