title: Unable to change type of a column from uuid to INT in postgresql
body: <p>I have table in rails calibration_sessions:</p>
  
  <pre><code>t.uuid "calibration_cycle_id", null: false
  t.datetime "created_at", null: false
  t.integer "creator_id", null: false
  t.datetime "deleted_at"
  t.string "name", null: false
  t.jsonb "state_transition_progress", default: []
  t.string "status", null: false
  t.datetime "updated_at", null: false
  t.integer "updater_id", null: false
  t.uuid "uuid", default: -&gt; { "uuid_generate_v4()" }, null: false
  t.index ["calibration_cycle_id", "status", "deleted_at"], name: "index_calibration_sessions_on_cycle_and_status_and_deleted_at", using: :btree
  t.index ["creator_id"], name: "index_calibrations_sessions_on_creator_id", using: :btree
  </code></pre>
  
  <p>the above is the schema for the table. </p>
  
  <p>I am trying to change the type of column calibration_cycle_id to type INT.</p>
  
  <pre><code>TRUNCATE TABLE calibrations_sessions;
  ALTER TABLE calibrations_sessions ALTER COLUMN calibration_cycle_id TYPE INT USING calibration_cycle_id::integer;
  </code></pre>
  
  <p>How ever I get the following error:    </p>
  
  <pre><code>ERROR:  cannot cast type uuid to integer
  LINE 1: ...ation_cycle_id TYPE INT USING calibration_cycle_id::integer;
  </code></pre>
  
  <p>What am I doing wrong here?</p>