title: PostgreSQL convert a string with commas into an integer
body: <p>I want to convert a column of type "character varying" that has integers with commas to a regular integer column.  </p>
  
  <p>I want to support numbers from '1' to '10,000,000'.</p>
  
  <p>I've tried to use: to_number(fieldname, '999G999G999'), but it only works if the format matches the exact length of the string.</p>
  
  <p>Is there a way to do this that supports from '1' to '10,000,000'?</p>