diff --git modules/block/block.install modules/block/block.install
index a21e8d2..787574d 100644
--- modules/block/block.install
+++ modules/block/block.install
@@ -155,8 +155,8 @@ function block_schema() {
         'description' => 'Block description.',
       ),
       'format' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
+        'type' => 'varchar',
+        'length' => 64,
         'not null' => FALSE,
         'description' => 'The {filter_format}.format of the block body.',
       ),
diff --git modules/field/modules/text/text.install modules/field/modules/text/text.install
index ce0178c..45b3c8a 100644
--- modules/field/modules/text/text.install
+++ modules/field/modules/text/text.install
@@ -48,8 +48,8 @@ function text_field_schema($field) {
   }
   $columns += array(
     'format' => array(
-      'type' => 'int',
-      'unsigned' => TRUE,
+      'type' => 'varchar',
+      'length' => 64,
       'not null' => FALSE,
     ),
   );
diff --git modules/field/modules/text/text.test modules/field/modules/text/text.test
index eaab367..a810cac 100644
--- modules/field/modules/text/text.test
+++ modules/field/modules/text/text.test
@@ -198,7 +198,10 @@ class TextFieldTestCase extends DrupalWebTestCase {
     // Create a new text format that does not escape HTML, and grant the user
     // access to it.
     $this->drupalLogin($this->admin_user);
-    $edit = array('name' => $this->randomName());
+    $edit = array(
+      'format' => drupal_strtolower($this->randomName()),
+      'name' => $this->randomName(),
+    );
     $this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
     filter_formats_reset();
     $this->checkPermissions(array(), TRUE);
@@ -386,8 +389,15 @@ class TextTranslationTestCase extends DrupalWebTestCase {
   function setUp() {
     parent::setUp('locale', 'translation');
 
-    $this->format = 3;
-    $this->admin = $this->drupalCreateUser(array('administer languages', 'administer content types', 'access administration pages', 'bypass node access', "use text format $this->format"));
+    $full_html_format = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Full HTML'))->fetchObject();
+    $this->format = $full_html_format->format;
+    $this->admin = $this->drupalCreateUser(array(
+      'administer languages',
+      'administer content types',
+      'access administration pages',
+      'bypass node access',
+      filter_permission_name($full_html_format),
+    ));
     $this->translator = $this->drupalCreateUser(array('create article content', 'edit own article content', 'translate content'));
 
     // Enable an additional language.
diff --git modules/filter/filter.admin.inc modules/filter/filter.admin.inc
index a1c8417..d1959bb 100644
--- modules/filter/filter.admin.inc
+++ modules/filter/filter.admin.inc
@@ -96,7 +96,10 @@ function theme_filter_admin_overview($variables) {
 function filter_admin_format_page($format = NULL) {
   if (!isset($format->name)) {
     drupal_set_title(t('Add text format'));
-    $format = (object) array('name' => '', 'format' => 0);
+    $format = (object) array(
+      'format' => NULL,
+      'name' => '',
+    );
   }
   return drupal_get_form('filter_admin_format_form', $format);
 }
@@ -122,6 +125,14 @@ function filter_admin_format_form($form, &$form_state, $format) {
     '#default_value' => $format->name,
     '#required' => TRUE,
   );
+  $form['format'] = array(
+    '#type' => 'textfield', // @todo http://drupal.org/node/902644
+    '#default_value' => $format->format,
+    '#machine_name_exists' => 'filter_format_load',
+    // Since the machine name needs to relate to the text format ID, it cannot
+    // be changed after initial creation.
+    '#disabled' => !empty($format->format),
+  );
 
   // Add user role access selection.
   $form['roles'] = array(
@@ -227,9 +238,6 @@ function filter_admin_format_form($form, &$form_state, $format) {
     }
   }
 
-  if (!empty($format->format)) {
-    $form['format'] = array('#type' => 'value', '#value' => $format->format);
-  }
   $form['actions'] = array('#type' => 'actions');
   $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
 
diff --git modules/filter/filter.install modules/filter/filter.install
index fd82ae1..3df5fed 100644
--- modules/filter/filter.install
+++ modules/filter/filter.install
@@ -14,9 +14,9 @@ function filter_schema() {
     'description' => 'Table that maps filters (HTML corrector) to text formats (Filtered HTML).',
     'fields' => array(
       'format' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => FALSE,
         'description' => 'Foreign key: The {filter_format}.format to which this filter is assigned.',
       ),
       'module' => array(
@@ -62,16 +62,17 @@ function filter_schema() {
     'description' => 'Stores text formats: custom groupings of filters, such as Filtered HTML.',
     'fields' => array(
       'format' => array(
-        'type' => 'serial',
+        'type' => 'varchar',
+        'length' => 64,
         'not null' => TRUE,
-        'description' => 'Primary Key: Unique ID for format.',
+        'description' => 'Primary Key: Unique machine name of the format.',
       ),
       'name' => array(
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
-        'description' => 'Name of the text format (Filtered HTML).',
+        'description' => 'Name of the format.',
         'translatable' => TRUE,
       ),
       'cache' => array(
@@ -97,9 +98,6 @@ function filter_schema() {
       ),
     ),
     'primary key' => array('format'),
-    'unique keys' => array(
-      'name' => array('name'),
-    ),
     'indexes' => array(
       'status_weight' => array('status', 'weight'),
     ),
@@ -120,6 +118,7 @@ function filter_install() {
   // plain text format with very basic formatting, but it can be modified by
   // installation profiles to have other properties.
   $plain_text_format = array(
+    'format' => 'plain_text',
     'name' => 'Plain text',
     'weight' => 10,
     'filters' => array(
@@ -470,6 +469,24 @@ function filter_update_7009() {
 }
 
 /**
+ * Change {filter_format}.format and {filter}.format into varchar.
+ */
+function filter_update_7010() {
+  db_change_field('filter_format', 'format', 'format', array(
+    'type' => 'varchar',
+    'length' => 64,
+    'not null' => TRUE,
+    'description' => 'Primary Key: Unique machine name of the format.',
+  ));
+  db_change_field('filter', 'format', 'format', array(
+    'type' => 'varchar',
+    'length' => 64,
+    'not null' => FALSE,
+    'description' => 'Foreign key: The {filter_format}.format to which this filter is assigned.',
+  ));
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
diff --git modules/filter/filter.module modules/filter/filter.module
index aed3c21..b1b56ca 100644
--- modules/filter/filter.module
+++ modules/filter/filter.module
@@ -182,7 +182,7 @@ function filter_format_load($format_id) {
  *     - 'settings': (optional) An array of configured settings for the filter.
  *       See hook_filter_info() for details.
  */
-function filter_format_save(&$format) {
+function filter_format_save($format) {
   $format->name = trim($format->name);
   $format->cache = _filter_format_is_cacheable($format);
   $format->status = 1;
@@ -192,7 +192,8 @@ function filter_format_save(&$format) {
   }
 
   // Add a new text format.
-  if (empty($format->format)) {
+  $exists = db_query_range('SELECT 1 FROM {filter_format} WHERE format = :format', 0, 1, array(':format' => $format->format))->fetchField();
+  if (!$exists) {
     $return = drupal_write_record('filter_format', $format);
   }
   else {
@@ -322,7 +323,7 @@ function filter_permission() {
  *   is malformed or is the fallback format (which is available to all users).
  */
 function filter_permission_name($format) {
-  if (isset($format->format) && $format->format != filter_fallback_format()) {
+  if (isset($format->format) && $format->format !== filter_fallback_format()) {
     return 'use text format ' . $format->format;
   }
   return FALSE;
diff --git modules/filter/filter.test modules/filter/filter.test
index 54145a6..0059c41 100644
--- modules/filter/filter.test
+++ modules/filter/filter.test
@@ -23,6 +23,7 @@ class FilterCRUDTestCase extends DrupalWebTestCase {
   function testTextFormatCRUD() {
     // Add a text format with minimum data only.
     $format = new stdClass();
+    $format->format = 'empty_format';
     $format->name = 'Empty format';
     filter_format_save($format);
     $this->verifyTextFormat($format);
@@ -30,6 +31,7 @@ class FilterCRUDTestCase extends DrupalWebTestCase {
 
     // Add another text format specifying all possible properties.
     $format = new stdClass();
+    $format->format = 'custom_format';
     $format->name = 'Custom format';
     $format->filters = array(
       'filter_url' => array(
@@ -268,6 +270,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
 
     // Add format.
     $edit = array();
+    $edit['format'] = drupal_strtolower($this->randomName());
     $edit['name'] = $this->randomName();
     $edit['roles[2]'] = 1;
     $edit['filters[' . $second_filter . '][status]'] = TRUE;
@@ -424,7 +427,10 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
     $this->drupalLogin($this->filter_admin_user);
     $formats = array();
     for ($i = 0; $i < 2; $i++) {
-      $edit = array('name' => $this->randomName());
+      $edit = array(
+        'format' => drupal_strtolower($this->randomName()),
+        'name' => $this->randomName(),
+      );
       $this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
       $this->resetFilterCaches();
       $format_id = db_query("SELECT format FROM {filter_format} WHERE name = :name", array(':name' => $edit['name']))->fetchField();
@@ -656,7 +662,10 @@ class FilterDefaultFormatTestCase extends DrupalWebTestCase {
     $this->drupalLogin($admin_user);
     $formats = array();
     for ($i = 0; $i < 2; $i++) {
-      $edit = array('name' => $this->randomName());
+      $edit = array(
+        'format' => drupal_strtolower($this->randomName()),
+        'name' => $this->randomName(),
+      );
       $this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
       $this->resetFilterCaches();
       $format_id = db_query("SELECT format FROM {filter_format} WHERE name = :name", array(':name' => $edit['name']))->fetchField();
@@ -1684,6 +1693,7 @@ class FilterHooksTestCase extends DrupalWebTestCase {
     // Add a text format.
     $name = $this->randomName();
     $edit = array();
+    $edit['format'] = drupal_strtolower($this->randomName());
     $edit['name'] = $name;
     $edit['roles[1]'] = 1;
     $this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
diff --git modules/php/php.install modules/php/php.install
index bc5d7d6..bbe739e 100644
--- modules/php/php.install
+++ modules/php/php.install
@@ -17,6 +17,7 @@ function php_enable() {
   // subsequent clean installs.
   if (!$format_exists) {
     $php_format = array(
+      'format' => 'php_code',
       'name' => 'PHP code',
       // 'Plain text' format is installed with a weight of 10 by default. Use a
       // higher weight here to ensure that this format will not be the default
diff --git modules/search/search.test modules/search/search.test
index 1879661..105227b 100644
--- modules/search/search.test
+++ modules/search/search.test
@@ -712,9 +712,9 @@ class SearchCommentTestCase extends DrupalWebTestCase {
     // Enable check_plain() for 'Filtered HTML' text format.
     $filtered_html_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Filtered HTML'))->fetchField();
     $edit = array(
-      'filters[filter_html_escape][status]' => $filtered_html_format_id,
+      'filters[filter_html_escape][status]' => TRUE,
     );
-    $this->drupalPost('admin/config/content/formats/1', $edit, t('Save configuration'));
+    $this->drupalPost('admin/config/content/formats/' . $filtered_html_format_id, $edit, t('Save configuration'));
     // Allow anonymous users to search content.
     $edit = array(
       DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
diff --git modules/taxonomy/taxonomy.install modules/taxonomy/taxonomy.install
index e5b27ff..46ba4fe 100644
--- modules/taxonomy/taxonomy.install
+++ modules/taxonomy/taxonomy.install
@@ -51,8 +51,8 @@ function taxonomy_schema() {
         'translatable' => TRUE,
       ),
       'format' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
+        'type' => 'varchar',
+        'length' => 64,
         'not null' => FALSE,
         'description' => 'The {filter_format}.format of the description.',
       ),
diff --git modules/user/user.install modules/user/user.install
index 2170811..3c46d4c 100644
--- modules/user/user.install
+++ modules/user/user.install
@@ -167,8 +167,8 @@ function user_schema() {
         'description' => "User's signature.",
       ),
       'signature_format' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
+        'type' => 'varchar',
+        'length' => 64,
         'not null' => FALSE,
         'description' => 'The {filter_format}.format of the signature.',
       ),
diff --git profiles/standard/standard.install profiles/standard/standard.install
index 681fbdd..832ab08 100644
--- profiles/standard/standard.install
+++ profiles/standard/standard.install
@@ -9,6 +9,7 @@
 function standard_install() {
   // Add text formats.
   $filtered_html_format = array(
+    'format' => 'filtered_html',
     'name' => 'Filtered HTML',
     'weight' => 0,
     'filters' => array(
@@ -38,6 +39,7 @@ function standard_install() {
   filter_format_save($filtered_html_format);
 
   $full_html_format = array(
+    'format' => 'full_html',
     'name' => 'Full HTML',
     'weight' => 1,
     'filters' => array(
