title: Postgres: Concat multiple columns, while including nulls
body: <p>I have a table with four columns that I need to concat. Two of the columns contain some NULL values. </p>
  
  <p>I need the result to contain separators indicating all four columns, like so:</p>
  
  <pre><code>colA,colB,colC,colD
  </code></pre>
  
  <p>or if one column (here colB) was null,</p>
  
  <pre><code>colA,,colC,colD
  </code></pre>
  
  <p>I can't seem to find a clean way to do this. The best I have come up with is:</p>
  
  <pre><code>concat_ws(colA, COALESCE(colB, ''), COALESCE(colC, ''), colD, ',')
  </code></pre>
  
  <p>This feels cumbersome (especially because I need to do this repeatedly). Is there a better way?</p>