title: Convert postgresql column from character varying to integer
body: <p>I'm trying to change a column type from "character varying(15)" to an integer.</p>
  
  <p>If I run "=#SELECT columnX from tableY limit(10);" I get back:</p>
  
  <pre><code>columnX 
  ----------
  34.00
  12.00
  7.75
  18.50
  
  4.00
  11.25
  
  18.00
  16.50
  </code></pre>
  
  <p>If i run "=#\d+ columnX" i get back:</p>
  
  <pre><code>     Column     |         Type          |                           Modifiers                           | Storage  | Description 
  
  columnX       | character varying(15) | not null                                                      | extended | 
  </code></pre>
  
  <p>I've searched high and low, asked on the postgresql irc channel, but no one could figure out how to change it, I've tried:</p>
  
  <pre><code>ALTER TABLE race_horserecord ALTER COLUMN win_odds TYPE integer USING (win_odds::integer);
  </code></pre>
  
  <p>Also:</p>
  
  <pre><code>ALTER TABLE tableY ALTER COLUMN columnX TYPE integer USING (trim("columnX")::integer);
  </code></pre>
  
  <p>Every time I get back:</p>
  
  <p>"ERROR:  invalid input syntax for integer: "34.00""</p>
  
  <hr>
  
  <p>Any help would be appreciated.</p>