title: PostgreSQL convert varchar to numeric and get average
body: <p>I have a column that I want to get an average of, the column is varchar(200). I keep getting this error. How do I convert the column to numeric and get an average of it. </p>
  
  <p>Values in the column look like </p>
  
  <pre><code>16,000.00
  15,000.00
  16,000.00 etc
  </code></pre>
  
  <p>When I execute</p>
  
  <pre><code>select CAST((COALESCE( bonus,'0')) AS numeric)
  from tableone
  </code></pre>
  
  <p>... I get </p>
  
  <pre><code>ERROR: invalid input syntax for type numeric:
  </code></pre>