title: Convert postgres field of type varchar to numeric
body: <p>I have query to modify 2 million over records in postgres.<br>
  The problem is that one of the field is of type <code>VARCHAR</code>, and I need to do some mathematical operations on it. Right now I'm casting the field to numeric like this :-</p>
  
  <pre><code>CAST(attribute as numeric)
  </code></pre>
  
  <p>The whole query takes approximately 4 hours to run.<br>
  I am looking at ways to fasten then execution time. Are the any way I can change the field type from varchar to numeric first before I execute the query? I can't use alter table alter column type to do this.  </p>