title: Grouping by large number of columns with ordinal reference
body: <p>I have a lengthy query in postgres that requires grouping by 30 different columns referenced in the query</p>
  <p>At the moment, I have manually listed the <code>group by</code> columns by their ordinal value in the query</p>
  <pre><code>SELECT ...
  GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  </code></pre>
  <p>Does a better way of doing this exist? I have tried</p>
  <pre><code>SELECT...
  GROUP BY array(generate_series(1, 30))
  </code></pre>
  <p>But this method fails.  Is there a way to use <code>generate_series</code> in the <code>GROUP BY</code> clause to reference columns in the query in cases where queries require a large number of <code>group by</code> columns?</p>