diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc
index f5774de..9885b59 100644
--- a/includes/database/pgsql/schema.inc
+++ b/includes/database/pgsql/schema.inc
@@ -503,21 +503,21 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
 
     $spec = $this->processField($spec);
 
-    // We need to typecast the new column to best be able to transfer the data
-    // Schema_pgsql::getFieldTypeMap() will return possibilities that are not
-    // 'cast-able' such as 'serial' - so they need to be casted int instead.
-    if (in_array($spec['pgsql_type'], array('serial', 'bigserial', 'numeric'))) {
-      $typecast = 'int';
+    // Type 'serial' is known to PostgreSQL, but only during table creation,
+    // not when altering. Because of that, we create it here as an 'int'. After
+    // we create it we manually re-apply the sequence.
+    if (in_array($spec['pgsql_type'], array('serial', 'bigserial'))) {
+      $field_def = 'int';
     }
     else {
-      $typecast = $spec['pgsql_type'];
+      $field_def = $spec['pgsql_type'];
     }
 
     if (in_array($spec['pgsql_type'], array('varchar', 'character', 'text')) && isset($spec['length'])) {
-      $typecast .= '(' . $spec['length'] . ')';
+      $field_def .= '(' . $spec['length'] . ')';
     }
     elseif (isset($spec['precision']) && isset($spec['scale'])) {
-      $typecast .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')';
+      $field_def .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')';
     }
 
     // Remove old check constraints.
@@ -530,7 +530,7 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
     // Remove old default.
     $this->fieldSetNoDefault($table, $field);
 
-    $this->connection->query('ALTER TABLE {' . $table . '} ALTER "' . $field . '" TYPE ' . $typecast . ' USING "' . $field . '"::' . $typecast);
+    $this->connection->query('ALTER TABLE {' . $table . '} ALTER "' . $field . '" TYPE ' . $field_def . ' USING "' . $field . '"::' . $field_def);
 
     if (isset($spec['not null'])) {
       if ($spec['not null']) {
diff --git a/modules/simpletest/tests/schema.test b/modules/simpletest/tests/schema.test
index 4199428..c58b34f 100644
--- a/modules/simpletest/tests/schema.test
+++ b/modules/simpletest/tests/schema.test
@@ -378,7 +378,65 @@ class SchemaTestCase extends DrupalWebTestCase {
         ->fetchField();
       $this->assertEqual($field_value, $field_spec['default'], 'Default value registered.');
     }
+  }
+
+  /**
+   * Tests changing columns between numeric types.
+   */
+  function testSchemaChangeField() {
+    $field_specs = array(
+      array('type' => 'int', 'size' => 'normal','not null' => FALSE),
+      array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'initial' => 1, 'default' => 17),
+      array('type' => 'float', 'size' => 'normal', 'not null' => FALSE),
+      array('type' => 'float', 'size' => 'normal', 'not null' => TRUE, 'initial' => 1, 'default' => 7.3),
+      array('type' => 'numeric', 'scale' => 2, 'precision' => 10, 'not null' => FALSE),
+      array('type' => 'numeric', 'scale' => 2, 'precision' => 10, 'not null' => TRUE, 'initial' => 1, 'default' => 7),
+    );
+
+    foreach ($field_specs as $i => $old_spec) {
+      foreach ($field_specs as $j => $new_spec) {
+        if ($i === $j) {
+          // Do not change a field into itself.
+          continue;
+        }
+        $this->assertFieldChange($old_spec, $new_spec);
+      }
+    }
+  }
 
-    db_drop_field($table_name, $field_name);
+  /**
+   * Asserts that a field can be changed from one spec to another.
+   *
+   * @param $old_spec
+   *   The beginning field specification.
+   * @param $new_spec
+   *   The ending field specification.
+   */
+  protected function assertFieldChange($old_spec, $new_spec) {
+    $table_name = 'test_table_' . ($this->counter++);
+    $table_spec = array(
+      'fields' => array(
+        'serial_column' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+        'test_field' => $old_spec,
+      ),
+      'primary key' => array('serial_column'),
+    );
+    db_create_table($table_name, $table_spec);
+    $this->pass(format_string('Table %table created.', array('%table' => $table_name)));
+
+    // Check the characteristics of the field.
+    $this->assertFieldCharacteristics($table_name, 'test_field', $old_spec);
+
+    // Remove inserted rows.
+    db_truncate($table_name)->execute();
+
+    // Change the field.
+    db_change_field($table_name, 'test_field', 'test_field', $new_spec);
+
+    // Check the field was changed.
+    $this->assertFieldCharacteristics($table_name, 'test_field', $new_spec);
+
+    // Clean-up.
+    db_drop_table($table_name);
   }
 }
