title: Postgres select distinct values in OVER() function
body: <p>I would like to get set of unique ids as array.</p>
  
  <p>Example:</p>
  
  <pre><code>SELECT a.*, b.*, array_agg(a.id) OVER() as groups_ids 
  FROM author a 
  JOIN books as b
  </code></pre>
  
  <p>At this moment I get multiple the same <code>author.id</code> as many <code>books</code> belongs for <code>author</code>.</p>
  
  <p>How to get only distinct ids?</p>
  
  <p>Thank you.</p>