title: Merging multiple bytea rows based on id
body: <p>I'm working with a postgres database where I need to merge multiple rows into a row based on ID. </p>
  
  <pre><code>ID  | A  | B  | C  |
  --------------------
  1   | x  |    |    |
  1   | x  | y  |    |
  2   | x  |    | z  |
  3   |    | y  |    |
  3   |    |    | z  |
  </code></pre>
  
  <p>A, B and C are bytea columns.</p>
  
  <p>I need to merge it as follows:</p>
  
  <pre><code>ID  | A  | B  | C  |
  --------------------
  1   | x  | y  |    |
  2   | x  |    | z  |
  3   |    | y  | z  |
  </code></pre>
  
  <p>The problem occurs when I do GROUP BY on ID, as I'm not able to find a appropriate aggregate function for bytea columns.</p>