? Makefile
? check_plain_test.txt
? compress.php
? css
? d5-mysql+locale.sql
? d5-mysql.sql
? d5-pgsql.backup
? files
? filter_xss_test.txt
? head.ppj
? head.ppx
? patches
? test.js
? xss.php
? sites/all/modules
? sites/default/settings.php
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.236
diff -u -F^f -r1.236 update.php
--- update.php	20 Oct 2007 21:57:49 -0000	1.236
+++ update.php	7 Nov 2007 15:09:39 -0000
@@ -40,7 +40,7 @@
  * @return
  *   nothing, but modifies $ret parameter.
  */
-function db_add_column(&$ret, $table, $column, $type, $attributes = array()) {
+function db_old_add_column(&$ret, $table, $column, $type, $attributes = array()) {
   if (array_key_exists('not null', $attributes) and $attributes['not null']) {
     $not_null = 'NOT NULL';
   }
@@ -96,7 +96,7 @@ function db_add_column(&$ret, $table, $c
  * @return
  *   nothing, but modifies $ret parameter.
  */
-function db_change_column(&$ret, $table, $column, $column_new, $type, $attributes = array()) {
+function db_old_change_column(&$ret, $table, $column, $column_new, $type, $attributes = array()) {
   if (array_key_exists('not null', $attributes) and $attributes['not null']) {
     $not_null = 'NOT NULL';
   }
@@ -689,7 +689,7 @@ function update_create_batch_table() {
   }
 
   $schema['batch'] = array(
-    'fields' => array(
+    'columns' => array(
       'bid'       => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'token'     => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
       'timestamp' => array('type' => 'int', 'not null' => TRUE),
@@ -756,25 +756,25 @@ function update_fix_d6_requirements() {
 
   if (drupal_get_installed_schema_version('system') < 6000 && !variable_get('update_d6_requirements', FALSE)) {
     $spec = array('type' => 'int', 'size' => 'small', 'default' => 0, 'not null' => TRUE);
-    db_add_field($ret, 'cache', 'serialized', $spec);
-    db_add_field($ret, 'cache_filter', 'serialized', $spec);
-    db_add_field($ret, 'cache_page', 'serialized', $spec);
-    db_add_field($ret, 'cache_menu', 'serialized', $spec);
+    db_add_column($ret, 'cache', 'serialized', $spec);
+    db_add_column($ret, 'cache_filter', 'serialized', $spec);
+    db_add_column($ret, 'cache_page', 'serialized', $spec);
+    db_add_column($ret, 'cache_menu', 'serialized', $spec);
 
-    db_add_field($ret, 'system', 'info', array('type' => 'text'));
-    db_add_field($ret, 'system', 'owner', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+    db_add_column($ret, 'system', 'info', array('type' => 'text'));
+    db_add_column($ret, 'system', 'owner', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
     if (db_table_exists('locales_target')) {
-      db_add_field($ret, 'locales_target', 'language', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''));
+      db_add_column($ret, 'locales_target', 'language', array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''));
     }
     if (db_table_exists('locales_source')) {
-      db_add_field($ret, 'locales_source', 'textgroup', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'default'));
-      db_add_field($ret, 'locales_source', 'version', array('type' => 'varchar', 'length' => 20, 'not null' => TRUE, 'default' => 'none'));
+      db_add_column($ret, 'locales_source', 'textgroup', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'default'));
+      db_add_column($ret, 'locales_source', 'version', array('type' => 'varchar', 'length' => 20, 'not null' => TRUE, 'default' => 'none'));
     }
     variable_set('update_d6_requirements', TRUE);
 
     // Create the cache_block table. See system_update_6027() for more details.
     $schema['cache_block'] = array(
-      'fields' => array(
+      'columns' => array(
         'cid'        => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
         'data'       => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'),
         'expire'     => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.710
diff -u -F^f -r1.710 common.inc
--- includes/common.inc	4 Nov 2007 21:24:09 -0000	1.710
+++ includes/common.inc	7 Nov 2007 15:09:40 -0000
@@ -3070,27 +3070,27 @@ function _drupal_initialize_schema($modu
 }
 
 /**
- * Retrieve a list of fields from a table schema. The list is suitable for use in a SQL query.
+ * Retrieve a list of columns from a table schema. The list is suitable for use in a SQL query.
  *
  * @param $table
- *   The name of the table from which to retrieve fields.
+ *   The name of the table from which to retrieve columns.
  * @param
- *   An optional prefix to to all fields.
+ *   An optional prefix to add to all columns.
  *
- * @return An array of fields.
+ * @return An array of columns.
  **/
-function drupal_schema_fields_sql($table, $prefix = NULL) {
+function drupal_schema_columns_sql($table, $prefix = NULL) {
   $schema = drupal_get_schema($table);
-  $fields = array_keys($schema['fields']);
+  $columns = array_keys($schema['columns']);
   if ($prefix) {
     $columns = array();
-    foreach ($fields as $field) {
-      $columns[] = "$prefix.$field";
+    foreach ($columns as $column) {
+      $columns[] = "$prefix.$column";
     }
     return $columns;
   }
   else {
-    return $fields;
+    return $columns;
   }
 }
 
@@ -3107,12 +3107,12 @@ function drupal_schema_fields_sql($table
  *   the schema may be filled in on the object, as well as ID on the serial
  *   type(s). Both array an object types may be passed.
  * @param update
- *   If this is an update, specify the primary keys' field names. It is the
+ *   If this is an update, specify the primary keys' column names. It is the
  *   caller's responsibility to know if a record for this object already
  *   exists in the database. If there is only 1 key, you may pass a simple string.
  * @return (boolean) Failure to write a record will return FALSE. Otherwise,
  *   TRUE is returned. The $object parameter contains values for any serial
- *   fields defined by the $table. For example, $object->nid will be populated
+ *   columns defined by the $table. For example, $object->nid will be populated
  *   after inserting a new node.
  */
 function drupal_write_record($table, &$object, $update = array()) {
@@ -3135,38 +3135,38 @@ function drupal_write_record($table, &$o
     return FALSE;
   }
 
-  $fields = $defs = $values = $serials = array();
+  $columns = $defs = $values = $serials = array();
 
   // Go through our schema, build SQL, and when inserting, fill in defaults for
-  // fields that are not set.
-  foreach ($schema['fields'] as $field => $info) {
+  // columns that are not set.
+  foreach ($schema['columns'] as $column => $info) {
     // Special case -- skip serial types if we are updating.
     if ($info['type'] == 'serial' && count($update)) {
       continue;
     }
 
     // For inserts, populate defaults from Schema if not already provided
-    if (!isset($object->$field)  && !count($update) && isset($info['default'])) {
-      $object->$field = $info['default'];
+    if (!isset($object->$column)  && !count($update) && isset($info['default'])) {
+      $object->$column = $info['default'];
     }
 
-    // Track serial fields so we can helpfully populate them after the query.
+    // Track serial columns so we can helpfully populate them after the query.
     if ($info['type'] == 'serial') {
-      $serials[] = $field;
+      $serials[] = $column;
       // Ignore values for serials when inserting data. Unsupported.
-      unset($object->$field);
+      unset($object->$column);
     }
 
-    // Build arrays for the fields, placeholders, and values in our query.
-    if (isset($object->$field)) {
-      $fields[] = $field;
+    // Build arrays for the columns, placeholders, and values in our query.
+    if (isset($object->$column)) {
+      $columns[] = $column;
       $placeholders[] = db_type_placeholder($info['type']);
 
       if (empty($info['serialize'])) {
-        $values[] = $object->$field;
+        $values[] = $object->$column;
       }
       else {
-        $values[] = serialize($object->$field);
+        $values[] = serialize($object->$column);
       }
     }
   }
@@ -3174,20 +3174,20 @@ function drupal_write_record($table, &$o
   // Build the SQL.
   $query = '';
   if (!count($update)) {
-    $query = "INSERT INTO {". $table ."} (". implode(', ', $fields) .') VALUES ('. implode(', ', $placeholders) .')';
+    $query = "INSERT INTO {". $table ."} (". implode(', ', $columns) .') VALUES ('. implode(', ', $placeholders) .')';
     $return = SAVED_NEW;
   }
   else {
     $query = '';
-    foreach ($fields as $id => $field) {
+    foreach ($columns as $id => $column) {
       if ($query) {
         $query .= ', ';
       }
-      $query .= $field .' = '. $placeholders[$id];
+      $query .= $column .' = '. $placeholders[$id];
     }
 
     foreach ($update as $key){
-      $conditions[] = "$key = ". db_type_placeholder($schema['fields'][$key]['type']);
+      $conditions[] = "$key = ". db_type_placeholder($schema['columns'][$key]['type']);
       $values[] = $object->$key;
     }
 
@@ -3198,8 +3198,8 @@ function drupal_write_record($table, &$o
 
   if ($serials) {
     // Get last insert ids and fill them in.
-    foreach ($serials as $field) {
-      $object->$field = db_last_insert_id($table, $field);
+    foreach ($serials as $column) {
+      $object->$column = db_last_insert_id($table, $column);
     }
   }
 
Index: includes/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.inc,v
retrieving revision 1.84
diff -u -F^f -r1.84 database.inc
--- includes/database.inc	12 Oct 2007 14:19:44 -0000	1.84
+++ includes/database.inc	7 Nov 2007 15:09:40 -0000
@@ -190,13 +190,13 @@ function _db_query_callback($match, $ini
 /**
  * Generate placeholders for an array of query arguments of a single type.
  *
- * Given a Schema API field type, return correct %-placeholders to
+ * Given a Schema API column type, return correct %-placeholders to
  * embed in a query
  *
  * @param $arguments
  *  An array with at least one element.
  * @param $type
- *   The Schema API type of a field (e.g. 'int', 'text', or 'varchar').
+ *   The Schema API type of a column (e.g. 'int', 'text', or 'varchar').
  */
 function db_placeholders($arguments, $type = 'int') {
   $placeholder = db_type_placeholder($type);
@@ -340,99 +340,8 @@ function db_escape_table($string) {
  * supported database engines.
  *
  * hook_schema() should return an array with a key for each table that
- * the module defines.
- *
- * The following keys are defined:
- *
- *   - 'description': A string describing this table and its purpose.
- *     References to other tables should be enclosed in
- *     curly-brackets.  For example, the node_revisions table
- *     description field might contain "Stores per-revision title and
- *     body data for each {node}."
- *   - 'fields': An associative array ('fieldname' => specification)
- *     that describes the table's database columns.  The specification
- *     is also an array.  The following specification parameters are defined:
- *
- *     - 'description': A string describing this field and its purpose.
- *       References to other tables should be enclosed in
- *       curly-brackets.  For example, the node table vid field
- *       description might contain "Always holds the largest (most
- *       recent) {node_revisions}.vid value for this nid."
- *     - 'type': The generic datatype: 'varchar', 'int', 'serial'
- *       'float', 'numeric', 'text', 'blob' or 'datetime'.  Most types
- *       just map to the according database engine specific
- *       datatypes.  Use 'serial' for auto incrementing fields. This
- *       will expand to 'int auto_increment' on mysql.
- *     - 'size': The data size: 'tiny', 'small', 'medium', 'normal',
- *       'big'.  This is a hint about the largest value the field will
- *       store and determines which of the database engine specific
- *       datatypes will be used (e.g. on MySQL, TINYINT vs. INT vs. BIGINT).
- *       'normal', the default, selects the base type (e.g. on MySQL,
- *       INT, VARCHAR, BLOB, etc.).
- *
- *       Not all sizes are available for all data types. See
- *       db_type_map() for possible combinations.
- *     - 'not null': If true, no NULL values will be allowed in this
- *       database column.  Defaults to false.
- *     - 'default': The field's default value.  The PHP type of the
- *       value matters: '', '0', and 0 are all different.  If you
- *       specify '0' as the default value for a type 'int' field it
- *       will not work because '0' is a string containing the
- *       character "zero", not an integer.
- *     - 'length': The maximal length of a type 'varchar' or 'text'
- *       field.  Ignored for other field types.
- *     - 'unsigned': A boolean indicating whether a type 'int', 'float'
- *       and 'numeric' only is signed or unsigned.  Defaults to
- *       FALSE.  Ignored for other field types.
- *     - 'precision', 'scale': For type 'numeric' fields, indicates
- *       the precision (total number of significant digits) and scale
- *       (decimal digits right of the decimal point).  Both values are
- *       mandatory.  Ignored for other field types.
- *
- *     All parameters apart from 'type' are optional except that type
- *     'numeric' columns must specify 'precision' and 'scale'.
- *
- *  - 'primary key': An array of one or more key column specifiers (see below)
- *    that form the primary key.
- *  - 'unique key': An associative array of unique keys ('keyname' =>
- *    specification).  Each specification is an array of one or more
- *    key column specifiers (see below) that form a unique key on the table.
- *  - 'indexes':  An associative array of indexes ('indexame' =>
- *    specification).  Each specification is an array of one or more
- *    key column specifiers (see below) that form an index on the
- *    table.
- *
- * A key column specifier is either a string naming a column or an
- * array of two elements, column name and length, specifying a prefix
- * of the named column.
- *
- * As an example, here is a SUBSET of the schema definition for
- * Drupal's 'node' table.  It show four fields (nid, vid, type, and
- * title), the primary key on field 'nid', a unique key named 'vid' on
- * field 'vid', and two indexes, one named 'nid' on field 'nid' and
- * one named 'node_title_type' on the field 'title' and the first four
- * bytes of the field 'type':
- *
- * @code
- * $schema['node'] = array(
- *   'fields' => array(
- *     'nid'      => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
- *     'vid'      => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
- *     'type'     => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
- *     'title'    => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- *   ),
- *   'primary key' => array('nid'),
- *   'unique keys' => array(
- *     'vid'     => array('vid')
- *   ),
- *   'indexes' => array(
- *     'nid'                 => array('nid'),
- *     'node_title_type'     => array('title', array('type', 4)),
- *   ),
- * );
- * @endcode
- *
- * @see drupal_install_schema()
+ * the module defines.  For complete details, see
+ * http://drupal.org/node/146866.
  */
 
  /**
@@ -453,37 +362,37 @@ function db_create_table(&$ret, $name, $
 }
 
 /**
- * Return an array of field names from an array of key/index column specifiers.
+ * Return an array of column names from an array of key/index column specifiers.
  *
  * This is usually an identity function but if a key/index uses a column prefix
  * specification, this function extracts just the name.
  *
- * @param $fields
+ * @param $columns
  *   An array of key/index column specifiers.
  * @return
- *   An array of field names.
+ *   An array of column names.
  */
-function db_field_names($fields) {
+function db_column_names($columns) {
   $ret = array();
-  foreach ($fields as $field) {
-    if (is_array($field)) {
-      $ret[] = $field[0];
+  foreach ($columns as $column) {
+    if (is_array($column)) {
+      $ret[] = $column[0];
     }
     else {
-      $ret[] = $field;
+      $ret[] = $column;
     }
   }
   return $ret;
 }
 
 /**
- * Given a Schema API field type, return the correct %-placeholder.
+ * Given a Schema API column type, return the correct %-placeholder.
  *
  * Embed the placeholder in a query to be passed to db_query and and pass as an
  * argument to db_query a value of the specified type.
  *
  * @param $type
- *   The Schema API type of a field.
+ *   The Schema API type of a column.
  * @return
  *   The placeholder string to embed in a query for that type.
  */
Index: includes/database.mysql-common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysql-common.inc,v
retrieving revision 1.13
diff -u -F^f -r1.13 database.mysql-common.inc
--- includes/database.mysql-common.inc	2 Oct 2007 16:15:56 -0000	1.13
+++ includes/database.mysql-common.inc	7 Nov 2007 15:09:40 -0000
@@ -65,9 +65,9 @@ function db_create_table_sql($name, $tab
 
   $sql = "CREATE TABLE {". $name ."} (\n";
 
-  // Add the SQL statement for each field.
-  foreach ($table['fields'] as $field_name => $field) {
-    $sql .= _db_create_field_sql($field_name, _db_process_field($field)) .", \n";
+  // Add the SQL statement for each column.
+  foreach ($table['columns'] as $column_name => $column) {
+    $sql .= _db_create_column_sql($column_name, _db_process_column($column)) .", \n";
   }
 
   // Process keys & indexes.
@@ -91,69 +91,69 @@ function _db_create_keys_sql($spec) {
     $keys[] = 'PRIMARY KEY ('. _db_create_key_sql($spec['primary key']) .')';
   }
   if (!empty($spec['unique keys'])) {
-    foreach ($spec['unique keys'] as $key => $fields) {
-      $keys[] = 'UNIQUE KEY '. $key .' ('. _db_create_key_sql($fields) .')';
+    foreach ($spec['unique keys'] as $key => $columns) {
+      $keys[] = 'UNIQUE KEY '. $key .' ('. _db_create_key_sql($columns) .')';
     }
   }
   if (!empty($spec['indexes'])) {
-    foreach ($spec['indexes'] as $index => $fields) {
-      $keys[] = 'INDEX '. $index .' ('. _db_create_key_sql($fields) .')';
+    foreach ($spec['indexes'] as $index => $columns) {
+      $keys[] = 'INDEX '. $index .' ('. _db_create_key_sql($columns) .')';
     }
   }
 
   return $keys;
 }
 
-function _db_create_key_sql($fields) {
+function _db_create_key_sql($columns) {
   $ret = array();
-  foreach ($fields as $field) {
-    if (is_array($field)) {
-      $ret[] = $field[0] .'('. $field[1] .')';
+  foreach ($columns as $column) {
+    if (is_array($column)) {
+      $ret[] = $column[0] .'('. $column[1] .')';
     }
     else {
-      $ret[] = $field;
+      $ret[] = $column;
     }
   }
   return implode(', ', $ret);
 }
 
 /**
- * Set database-engine specific properties for a field.
+ * Set database-engine specific properties for a column.
  *
- * @param $field
- *   A field description array, as specified in the schema documentation.
+ * @param $column
+ *   A column description array, as specified in the schema documentation.
  */
-function _db_process_field($field) {
+function _db_process_column($column) {
 
-  if (!isset($field['size'])) {
-    $field['size'] = 'normal';
+  if (!isset($column['size'])) {
+    $column['size'] = 'normal';
   }
 
   // Set the correct database-engine specific datatype.
-  if (!isset($field['mysql_type'])) {
+  if (!isset($column['mysql_type'])) {
     $map = db_type_map();
-    $field['mysql_type'] = $map[$field['type'] .':'. $field['size']];
+    $column['mysql_type'] = $map[$column['type'] .':'. $column['size']];
   }
 
-  if ($field['type'] == 'serial') {
-    $field['auto_increment'] = TRUE;
+  if ($column['type'] == 'serial') {
+    $column['auto_increment'] = TRUE;
   }
 
-  return $field;
+  return $column;
 }
 
 /**
- * Create an SQL string for a field to be used in table creation or alteration.
+ * Create an SQL string for a column to be used in table creation or alteration.
  *
- * Before passing a field out of a schema definition into this function it has
- * to be processed by _db_process_field().
+ * Before passing a column out of a schema definition into this function it has
+ * to be processed by _db_process_column().
  *
  * @param $name
- *    Name of the field.
+ *    Name of the column.
  * @param $spec
- *    The field specification, as per the schema data structure format.
+ *    The column specification, as per the schema data structure format.
  */
-function _db_create_field_sql($name, $spec) {
+function _db_create_column_sql($name, $spec) {
   $sql = "`". $name ."` ". $spec['mysql_type'];
 
   if (isset($spec['length'])) {
@@ -261,79 +261,79 @@ function db_drop_table(&$ret, $table) {
 }
 
 /**
- * Add a new field to a table.
+ * Add a new column to a table.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   Name of the table to be altered.
- * @param $field
- *   Name of the field to be added.
+ * @param $column
+ *   Name of the column to be added.
  * @param $spec
- *   The field specification array, as taken from a schema definition.
+ *   The column specification array, as taken from a schema definition.
  *   The specification may also contain the key 'initial', the newly
- *   created field will be set to the value of the key in all rows.
+ *   created column will be set to the value of the key in all rows.
  *   This is most useful for creating NOT NULL columns with no default
  *   value in existing tables.
  * @param $keys_new
  *   Optional keys and indexes specification to be created on the
- *   table along with adding the field. The format is the same as a
- *   table specification but without the 'fields' element.  If you are
- *   adding a type 'serial' field, you MUST specify at least one key
- *   or index including it in this array. @see db_change_field for more
+ *   table along with adding the column. The format is the same as a
+ *   table specification but without the 'columns' element.  If you are
+ *   adding a type 'serial' column, you MUST specify at least one key
+ *   or index including it in this array. @see db_change_column for more
  *   explanation why.
  */
-function db_add_field(&$ret, $table, $field, $spec, $keys_new = array()) {
+function db_add_column(&$ret, $table, $column, $spec, $keys_new = array()) {
   $fixnull = FALSE;
   if (!empty($spec['not null']) && !isset($spec['default'])) {
     $fixnull = TRUE;
     $spec['not null'] = FALSE;
   }
   $query = 'ALTER TABLE {'. $table .'} ADD ';
-  $query .= _db_create_field_sql($field, _db_process_field($spec));
+  $query .= _db_create_column_sql($column, _db_process_column($spec));
   if (count($keys_new)) {
     $query .= ', ADD '. implode(', ADD ', _db_create_keys_sql($keys_new));
   }
   $ret[] = update_sql($query);
   if (isset($spec['initial'])) {
     // All this because update_sql does not support %-placeholders.
-    $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']);
+    $sql = 'UPDATE {'. $table .'} SET '. $column .' = '. db_type_placeholder($spec['type']);
     $result = db_query($sql, $spec['initial']);
     $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')'));
   }
   if ($fixnull) {
     $spec['not null'] = TRUE;
-    db_change_field($ret, $table, $field, $field, $spec);
+    db_change_column($ret, $table, $column, $column, $spec);
   }
 }
 
 /**
- * Drop a field.
+ * Drop a column.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $field
- *   The field to be dropped.
+ * @param $column
+ *   The column to be dropped.
  */
-function db_drop_field(&$ret, $table, $field) {
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP '. $field);
+function db_drop_column(&$ret, $table, $column) {
+  $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP '. $column);
 }
 
 /**
- * Set the default value for a field.
+ * Set the default value for a column.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $field
- *   The field to be altered.
+ * @param $column
+ *   The column to be altered.
  * @param $default
  *   Default value to be set. NULL for 'default NULL'.
  */
-function db_field_set_default(&$ret, $table, $field, $default) {
+function db_column_set_default(&$ret, $table, $column, $default) {
   if ($default == NULL) {
     $default = 'NULL';
   }
@@ -341,21 +341,21 @@ function db_field_set_default(&$ret, $ta
     $default = is_string($default) ? "'$default'" : $default;
   }
 
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' SET DEFAULT '. $default);
+  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $column .' SET DEFAULT '. $default);
 }
 
 /**
- * Set a field to have no default value.
+ * Set a column to have no default value.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $field
- *   The field to be altered.
+ * @param $column
+ *   The column to be altered.
  */
-function db_field_set_no_default(&$ret, $table, $field) {
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' DROP DEFAULT');
+function db_column_set_no_default(&$ret, $table, $column) {
+  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $column .' DROP DEFAULT');
 }
 
 /**
@@ -365,12 +365,12 @@ function db_field_set_no_default(&$ret, 
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $fields
- *   Fields for the primary key.
+ * @param $columns
+ *   Columns for the primary key.
  */
-function db_add_primary_key(&$ret, $table, $fields) {
+function db_add_primary_key(&$ret, $table, $columns) {
   $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('.
-    _db_create_key_sql($fields) .')');
+    _db_create_key_sql($columns) .')');
 }
 
 /**
@@ -394,12 +394,12 @@ function db_drop_primary_key(&$ret, $tab
  *   The table to be altered.
  * @param $name
  *   The name of the key.
- * @param $fields
- *   An array of field names.
+ * @param $columns
+ *   An array of column names.
  */
-function db_add_unique_key(&$ret, $table, $name, $fields) {
+function db_add_unique_key(&$ret, $table, $name, $columns) {
   $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD UNIQUE KEY '.
-    $name .' ('. _db_create_key_sql($fields) .')');
+    $name .' ('. _db_create_key_sql($columns) .')');
 }
 
 /**
@@ -425,11 +425,11 @@ function db_drop_unique_key(&$ret, $tabl
  *   The table to be altered.
  * @param $name
  *   The name of the index.
- * @param $fields
- *   An array of field names.
+ * @param $columns
+ *   An array of column names.
  */
-function db_add_index(&$ret, $table, $name, $fields) {
-  $query = 'ALTER TABLE {'. $table .'} ADD INDEX '. $name .' ('. _db_create_key_sql($fields) .')';
+function db_add_index(&$ret, $table, $name, $columns) {
+  $query = 'ALTER TABLE {'. $table .'} ADD INDEX '. $name .' ('. _db_create_key_sql($columns) .')';
   $ret[] = update_sql($query);
 }
 
@@ -448,20 +448,20 @@ function db_drop_index(&$ret, $table, $n
 }
 
 /**
- * Change a field definition.
+ * Change a column definition.
  *
  * IMPORTANT NOTE: To maintain database portability, you have to explicitly
- * recreate all indices and primary keys that are using the changed field.
+ * recreate all indices and primary keys that are using the changed column.
  *
  * That means that you have to drop all affected keys and indexes with
- * db_drop_{primary_key,unique_key,index}() before calling db_change_field().
+ * db_drop_{primary_key,unique_key,index}() before calling db_change_column().
  * To recreate the keys and indices, pass the key definitions as the
- * optional $keys_new argument directly to db_change_field().
+ * optional $keys_new argument directly to db_change_column().
  *
  * For example, suppose you have:
  * @code
  * $schema['foo'] = array(
- *   'fields' => array(
+ *   'columns' => array(
  *     'bar' => array('type' => 'int', 'not null' => TRUE)
  *   ),
  *   'primary key' => array('bar')
@@ -471,48 +471,48 @@ function db_drop_index(&$ret, $table, $n
  * primary key.  The correct sequence is:
  * @code
  * db_drop_primary_key($ret, 'foo');
- * db_change_field($ret, 'foo', 'bar', 'bar',
+ * db_change_column($ret, 'foo', 'bar', 'bar',
  *   array('type' => 'serial', 'not null' => TRUE),
  *   array('primary key' => array('bar')));
  * @endcode
  *
  * The reasons for this are due to the different database engines:
  *
- * On PostgreSQL, changing a field definition involves adding a new field
+ * On PostgreSQL, changing a column definition involves adding a new column
  * and dropping an old one which* causes any indices, primary keys and
- * sequences (from serial-type fields) that use the changed field to be dropped.
+ * sequences (from serial-type columns) that use the changed column to be dropped.
  *
- * On MySQL, all type 'serial' fields must be part of at least one key
+ * On MySQL, all type 'serial' columns must be part of at least one key
  * or index as soon as they are created.  You cannot use
  * db_add_{primary_key,unique_key,index}() for this purpose because
  * the ALTER TABLE command will fail to add the column without a key
  * or index specification.  The solution is to use the optional
  * $keys_new argument to create the key or index at the same time as
- * field.
+ * column.
  *
  * You could use db_add_{primary_key,unique_key,index}() in all cases
- * unless you are converting a field to be type serial. You can use
+ * unless you are converting a column to be type serial. You can use
  * the $keys_new argument in all cases.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   Name of the table.
- * @param $field
- *   Name of the field to change.
- * @param $field_new
- *   New name for the field (set to the same as $field if you don't want to change the name).
+ * @param $column
+ *   Name of the column to change.
+ * @param $column_new
+ *   New name for the column (set to the same as $column if you don't want to change the name).
  * @param $spec
- *   The field specification for the new field.
+ *   The column specification for the new column.
  * @param $keys_new
  *   Optional keys and indexes specification to be created on the
- *   table along with changing the field. The format is the same as a
- *   table specification but without the 'fields' element.
+ *   table along with changing the column. The format is the same as a
+ *   table specification but without the 'columns' element.
  */
 
-function db_change_field(&$ret, $table, $field, $field_new, $spec, $keys_new = array()) {
-  $sql = 'ALTER TABLE {'. $table .'} CHANGE '. $field .' '.
-    _db_create_field_sql($field_new, _db_process_field($spec));
+function db_change_column(&$ret, $table, $column, $column_new, $spec, $keys_new = array()) {
+  $sql = 'ALTER TABLE {'. $table .'} CHANGE '. $column .' '.
+    _db_create_column_sql($column_new, _db_process_column($spec));
   if (count($keys_new)) {
     $sql .= ', ADD '.implode(', ADD ', _db_create_keys_sql($keys_new));
   }
@@ -524,9 +524,9 @@ function db_change_field(&$ret, $table, 
  *
  * @param $table
  *   The name of the table you inserted into.
- * @param $field
- *   The name of the autoincrement field.
+ * @param $column
+ *   The name of the autoincrement column.
  */
-function db_last_insert_id($table, $field) {
+function db_last_insert_id($table, $column) {
   return db_result(db_query('SELECT LAST_INSERT_ID()'));
 }
Index: includes/database.pgsql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.pgsql.inc,v
retrieving revision 1.63
diff -u -F^f -r1.63 database.pgsql.inc
--- includes/database.pgsql.inc	17 Oct 2007 12:47:28 -0000	1.63
+++ includes/database.pgsql.inc	7 Nov 2007 15:09:41 -0000
@@ -507,9 +507,9 @@ function db_type_map() {
  *   An array of SQL statements to create the table.
  */
 function db_create_table_sql($name, $table) {
-  $sql_fields = array();
-  foreach ($table['fields'] as $field_name => $field) {
-    $sql_fields[] = _db_create_field_sql($field_name, _db_process_field($field));
+  $sql_columns = array();
+  foreach ($table['columns'] as $column_name => $column) {
+    $sql_columns[] = _db_create_column_sql($column_name, _db_process_column($column));
   }
 
   $sql_keys = array();
@@ -523,7 +523,7 @@ function db_create_table_sql($name, $tab
   }
 
   $sql = "CREATE TABLE {". $name ."} (\n\t";
-  $sql .= implode(",\n\t", $sql_fields);
+  $sql .= implode(",\n\t", $sql_columns);
   if (count($sql_keys) > 0) {
     $sql .= ",\n\t";
   }
@@ -540,20 +540,20 @@ function db_create_table_sql($name, $tab
   return $statements;
 }
 
-function _db_create_index_sql($table, $name, $fields) {
+function _db_create_index_sql($table, $name, $columns) {
   $query = 'CREATE INDEX {'. $table .'}_'. $name .'_idx ON {'. $table .'} (';
-  $query .= _db_create_key_sql($fields) .')';
+  $query .= _db_create_key_sql($columns) .')';
   return $query;
 }
 
-function _db_create_key_sql($fields) {
+function _db_create_key_sql($columns) {
   $ret = array();
-  foreach ($fields as $field) {
-    if (is_array($field)) {
-      $ret[] = 'substr('. $field[0] .', 1, '. $field[1] .')';
+  foreach ($columns as $column) {
+    if (is_array($column)) {
+      $ret[] = 'substr('. $column[0] .', 1, '. $column[1] .')';
     }
     else {
-      $ret[] = $field;
+      $ret[] = $column;
     }
   }
   return implode(', ', $ret);
@@ -564,50 +564,50 @@ function _db_create_keys(&$ret, $table, 
     db_add_primary_key($ret, $table, $new_keys['primary key']);
   }
   if (isset($new_keys['unique keys'])) {
-    foreach ($new_keys['unique keys'] as $name => $fields) {
-      db_add_unique_key($ret, $table, $name, $fields);
+    foreach ($new_keys['unique keys'] as $name => $columns) {
+      db_add_unique_key($ret, $table, $name, $columns);
     }
   }
   if (isset($new_keys['indexes'])) {
-    foreach ($new_keys['indexes'] as $name => $fields) {
-      db_add_index($ret, $table, $name, $fields);
+    foreach ($new_keys['indexes'] as $name => $columns) {
+      db_add_index($ret, $table, $name, $columns);
     }
   }
 }
 
 /**
- * Set database-engine specific properties for a field.
+ * Set database-engine specific properties for a column.
  *
- * @param $field
- *   A field description array, as specified in the schema documentation.
+ * @param $column
+ *   A column description array, as specified in the schema documentation.
  */
-function _db_process_field($field) {
-  if (!isset($field['size'])) {
-    $field['size'] = 'normal';
+function _db_process_column($column) {
+  if (!isset($column['size'])) {
+    $column['size'] = 'normal';
   }
   // Set the correct database-engine specific datatype.
-  if (!isset($field['pgsql_type'])) {
+  if (!isset($column['pgsql_type'])) {
     $map = db_type_map();
-    $field['pgsql_type'] = $map[$field['type'] .':'. $field['size']];
+    $column['pgsql_type'] = $map[$column['type'] .':'. $column['size']];
   }
-  if ($field['type'] == 'serial') {
-    unset($field['not null']);
+  if ($column['type'] == 'serial') {
+    unset($column['not null']);
   }
-  return $field;
+  return $column;
 }
 
 /**
- * Create an SQL string for a field to be used in table creation or alteration.
+ * Create an SQL string for a column to be used in table creation or alteration.
  *
- * Before passing a field out of a schema definition into this function it has
- * to be processed by _db_process_field().
+ * Before passing a column out of a schema definition into this function it has
+ * to be processed by _db_process_column().
  *
  * @param $name
- *    Name of the field.
+ *    Name of the column.
  * @param $spec
- *    The field specification, as per the schema data structure format.
+ *    The column specification, as per the schema data structure format.
  */
-function _db_create_field_sql($name, $spec) {
+function _db_create_column_sql($name, $spec) {
   $sql = $name .' '. $spec['pgsql_type'];
 
   if ($spec['type'] == 'serial') {
@@ -667,45 +667,45 @@ function db_drop_table(&$ret, $table) {
 }
 
 /**
- * Add a new field to a table.
+ * Add a new column to a table.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   Name of the table to be altered.
- * @param $field
- *   Name of the field to be added.
+ * @param $column
+ *   Name of the column to be added.
  * @param $spec
- *   The field specification array, as taken from a schema definition.
+ *   The column specification array, as taken from a schema definition.
  *   The specification may also contain the key 'initial', the newly
- *   created field will be set to the value of the key in all rows.
+ *   created column will be set to the value of the key in all rows.
  *   This is most useful for creating NOT NULL columns with no default
  *   value in existing tables.
  * @param $keys_new
  *   Optional keys and indexes specification to be created on the
- *   table along with adding the field. The format is the same as a
- *   table specification but without the 'fields' element.  If you are
- *   adding a type 'serial' field, you MUST specify at least one key
- *   or index including it in this array. @see db_change_field for more
+ *   table along with adding the column. The format is the same as a
+ *   table specification but without the 'columns' element.  If you are
+ *   adding a type 'serial' column, you MUST specify at least one key
+ *   or index including it in this array. @see db_change_column for more
  *   explanation why.
  */
-function db_add_field(&$ret, $table, $field, $spec, $new_keys = array()) {
+function db_add_column(&$ret, $table, $column, $spec, $new_keys = array()) {
   $fixnull = FALSE;
   if (!empty($spec['not null']) && !isset($spec['default'])) {
     $fixnull = TRUE;
     $spec['not null'] = FALSE;
   }
   $query = 'ALTER TABLE {'. $table .'} ADD COLUMN ';
-  $query .= _db_create_field_sql($field, _db_process_field($spec));
+  $query .= _db_create_column_sql($column, _db_process_column($spec));
   $ret[] = update_sql($query);
   if (isset($spec['initial'])) {
     // All this because update_sql does not support %-placeholders.
-    $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']);
+    $sql = 'UPDATE {'. $table .'} SET '. $column .' = '. db_type_placeholder($spec['type']);
     $result = db_query($sql, $spec['initial']);
     $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')'));
   }
   if ($fixnull) {
-    $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $field SET NOT NULL");
+    $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET NOT NULL");
   }
   if (isset($new_keys)) {
     _db_create_keys($ret, $table, $new_keys);
@@ -713,32 +713,32 @@ function db_add_field(&$ret, $table, $fi
 }
 
 /**
- * Drop a field.
+ * Drop a column.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $field
- *   The field to be dropped.
+ * @param $column
+ *   The column to be dropped.
  */
-function db_drop_field(&$ret, $table, $field) {
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP COLUMN '. $field);
+function db_drop_column(&$ret, $table, $column) {
+  $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP COLUMN '. $column);
 }
 
 /**
- * Set the default value for a field.
+ * Set the default value for a column.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $field
- *   The field to be altered.
+ * @param $column
+ *   The column to be altered.
  * @param $default
  *   Default value to be set. NULL for 'default NULL'.
  */
-function db_field_set_default(&$ret, $table, $field, $default) {
+function db_column_set_default(&$ret, $table, $column, $default) {
   if ($default == NULL) {
     $default = 'NULL';
   }
@@ -746,21 +746,21 @@ function db_field_set_default(&$ret, $ta
     $default = is_string($default) ? "'$default'" : $default;
   }
 
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' SET DEFAULT '. $default);
+  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $column .' SET DEFAULT '. $default);
 }
 
 /**
- * Set a field to have no default value.
+ * Set a column to have no default value.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $field
- *   The field to be altered.
+ * @param $column
+ *   The column to be altered.
  */
-function db_field_set_no_default(&$ret, $table, $field) {
-  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' DROP DEFAULT');
+function db_column_set_no_default(&$ret, $table, $column) {
+  $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $column .' DROP DEFAULT');
 }
 
 /**
@@ -770,12 +770,12 @@ function db_field_set_no_default(&$ret, 
  *   Array to which query results will be added.
  * @param $table
  *   The table to be altered.
- * @param $fields
- *   Fields for the primary key.
+ * @param $columns
+ *   Columns for the primary key.
  */
-function db_add_primary_key(&$ret, $table, $fields) {
+function db_add_primary_key(&$ret, $table, $columns) {
   $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('.
-    implode(',', $fields) .')');
+    implode(',', $columns) .')');
 }
 
 /**
@@ -799,13 +799,13 @@ function db_drop_primary_key(&$ret, $tab
  *   The table to be altered.
  * @param $name
  *   The name of the key.
- * @param $fields
- *   An array of field names.
+ * @param $columns
+ *   An array of column names.
  */
-function db_add_unique_key(&$ret, $table, $name, $fields) {
+function db_add_unique_key(&$ret, $table, $name, $columns) {
   $name = '{'. $table .'}_'. $name .'_key';
   $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD CONSTRAINT '.
-    $name .' UNIQUE ('. implode(',', $fields) .')');
+    $name .' UNIQUE ('. implode(',', $columns) .')');
 }
 
 /**
@@ -832,11 +832,11 @@ function db_drop_unique_key(&$ret, $tabl
  *   The table to be altered.
  * @param $name
  *   The name of the index.
- * @param $fields
- *   An array of field names.
+ * @param $columns
+ *   An array of column names.
  */
-function db_add_index(&$ret, $table, $name, $fields) {
-  $ret[] = update_sql(_db_create_index_sql($table, $name, $fields));
+function db_add_index(&$ret, $table, $name, $columns) {
+  $ret[] = update_sql(_db_create_index_sql($table, $name, $columns));
 }
 
 /**
@@ -855,20 +855,20 @@ function db_drop_index(&$ret, $table, $n
 }
 
 /**
- * Change a field definition.
+ * Change a column definition.
  *
  * IMPORTANT NOTE: To maintain database portability, you have to explicitly
- * recreate all indices and primary keys that are using the changed field.
+ * recreate all indices and primary keys that are using the changed column.
  *
  * That means that you have to drop all affected keys and indexes with
- * db_drop_{primary_key,unique_key,index}() before calling db_change_field().
+ * db_drop_{primary_key,unique_key,index}() before calling db_change_column().
  * To recreate the keys and indices, pass the key definitions as the
- * optional $new_keys argument directly to db_change_field().
+ * optional $new_keys argument directly to db_change_column().
  *
  * For example, suppose you have:
  * @code
  * $schema['foo'] = array(
- *   'fields' => array(
+ *   'columns' => array(
  *     'bar' => array('type' => 'int', 'not null' => TRUE)
  *   ),
  *   'primary key' => array('bar')
@@ -878,58 +878,58 @@ function db_drop_index(&$ret, $table, $n
  * primary key.  The correct sequence is:
  * @code
  * db_drop_primary_key($ret, 'foo');
- * db_change_field($ret, 'foo', 'bar', 'bar',
+ * db_change_column($ret, 'foo', 'bar', 'bar',
  *   array('type' => 'serial', 'not null' => TRUE),
  *   array('primary key' => array('bar')));
  * @endcode
  *
  * The reasons for this are due to the different database engines:
  *
- * On PostgreSQL, changing a field definition involves adding a new field
+ * On PostgreSQL, changing a column definition involves adding a new column
  * and dropping an old one which* causes any indices, primary keys and
- * sequences (from serial-type fields) that use the changed field to be dropped.
+ * sequences (from serial-type columns) that use the changed column to be dropped.
  *
- * On MySQL, all type 'serial' fields must be part of at least one key
+ * On MySQL, all type 'serial' columns must be part of at least one key
  * or index as soon as they are created.  You cannot use
  * db_add_{primary_key,unique_key,index}() for this purpose because
  * the ALTER TABLE command will fail to add the column without a key
  * or index specification.  The solution is to use the optional
  * $new_keys argument to create the key or index at the same time as
- * field.
+ * column.
  *
  * You could use db_add_{primary_key,unique_key,index}() in all cases
- * unless you are converting a field to be type serial. You can use
+ * unless you are converting a column to be type serial. You can use
  * the $new_keys argument in all cases.
  *
  * @param $ret
  *   Array to which query results will be added.
  * @param $table
  *   Name of the table.
- * @param $field
- *   Name of the field to change.
- * @param $field_new
- *   New name for the field (set to the same as $field if you don't want to change the name).
+ * @param $column
+ *   Name of the column to change.
+ * @param $column_new
+ *   New name for the column (set to the same as $column if you don't want to change the name).
  * @param $spec
- *   The field specification for the new field.
+ *   The column specification for the new column.
  * @param $new_keys
  *   Optional keys and indexes specification to be created on the
- *   table along with changing the field. The format is the same as a
- *   table specification but without the 'fields' element.
+ *   table along with changing the column. The format is the same as a
+ *   table specification but without the 'columns' element.
  */
-function db_change_field(&$ret, $table, $field, $field_new, $spec, $new_keys = array()) {
-  $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $field TO ". $field ."_old");
+function db_change_column(&$ret, $table, $column, $column_new, $spec, $new_keys = array()) {
+  $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $column TO ". $column ."_old");
   $not_null = isset($spec['not null']) ? $spec['not null'] : FALSE;
   unset($spec['not null']);
 
-  db_add_field($ret, $table, "$field_new", $spec);
+  db_add_column($ret, $table, "$column_new", $spec);
 
-  $ret[] = update_sql("UPDATE {". $table ."} SET $field_new = ". $field ."_old");
+  $ret[] = update_sql("UPDATE {". $table ."} SET $column_new = ". $column ."_old");
 
   if ($not_null) {
-    $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $field_new SET NOT NULL");
+    $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET NOT NULL");
   }
 
-  db_drop_field($ret, $table, $field .'_old');
+  db_drop_column($ret, $table, $column .'_old');
 
   if (isset($new_keys)) {
     _db_create_keys($ret, $table, $new_keys);
Index: modules/aggregator/aggregator.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v
retrieving revision 1.12
diff -u -F^f -r1.12 aggregator.install
--- modules/aggregator/aggregator.install	4 Nov 2007 14:33:06 -0000	1.12
+++ modules/aggregator/aggregator.install	7 Nov 2007 15:09:41 -0000
@@ -28,7 +28,7 @@ function aggregator_uninstall() {
 function aggregator_schema() {
   $schema['aggregator_category'] = array(
     'description' => t('Stores categories for aggregator feeds and feed items.'),
-    'fields' => array(
+    'columns' => array(
       'cid'  => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -61,7 +61,7 @@ function aggregator_schema() {
 
   $schema['aggregator_category_feed'] = array(
     'description' => t('Bridge table; maps feeds to categories.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'type' => 'int',
         'not null' => TRUE,
@@ -80,7 +80,7 @@ function aggregator_schema() {
 
   $schema['aggregator_category_item'] = array(
     'description' => t('Bridge table; maps feed items to categories.'),
-    'fields' => array(
+    'columns' => array(
       'iid' => array(
         'type' => 'int',
         'not null' => TRUE,
@@ -99,7 +99,7 @@ function aggregator_schema() {
 
   $schema['aggregator_feed'] = array(
     'description' => t('Stores feeds to be parsed by the aggregator.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -180,7 +180,7 @@ function aggregator_schema() {
 
   $schema['aggregator_item'] = array(
     'description' => t('Stores the individual items imported from feeds.'),
-    'fields' => array(
+    'columns' => array(
       'iid'  => array(
         'type' => 'serial',
         'not null' => TRUE,
Index: modules/block/block.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.install,v
retrieving revision 1.6
diff -u -F^f -r1.6 block.install
--- modules/block/block.install	6 Nov 2007 11:40:15 -0000	1.6
+++ modules/block/block.install	7 Nov 2007 15:09:41 -0000
@@ -7,7 +7,7 @@
 function block_schema() {
   $schema['blocks'] = array(
     'description' => t('Stores block settings, such as region and visibility settings.'),
-    'fields' => array(
+    'columns' => array(
       'bid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -79,6 +79,7 @@ function block_schema() {
       'pages' => array(
         'type' => 'text',
         'not null' => TRUE,
+	'default' => '',
         'description' => t('Contents of the "Pages" block; contains either a list of paths on which to include/exclude the block or PHP code, depending on "visibility" setting.'),
       ),
       'title' => array(
@@ -101,7 +102,7 @@ function block_schema() {
 
   $schema['blocks_roles'] = array(
     'description' => t('Sets up access permissions for blocks based on user roles'),
-    'fields' => array(
+    'columns' => array(
       'module' => array(
         'type' => 'varchar',
         'length' => 64,
@@ -130,7 +131,7 @@ function block_schema() {
 
   $schema['boxes'] = array(
     'description' => t('Stores contents of custom-made blocks.'),
-    'fields' => array(
+    'columns' => array(
       'bid' => array(
         'type' => 'serial',
   'unsigned' => TRUE,
Index: modules/book/book.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.install,v
retrieving revision 1.12
diff -u -F^f -r1.12 book.install
--- modules/book/book.install	25 Oct 2007 15:32:55 -0000	1.12
+++ modules/book/book.install	7 Nov 2007 15:09:41 -0000
@@ -63,7 +63,7 @@ function book_update_6000() {
   if (!isset($_SESSION['book_update_6000'])) {
 
     $schema['book'] = array(
-      'fields' => array(
+      'columns' => array(
         'mlid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
         'nid'     => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
         'bid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
@@ -108,7 +108,7 @@ function book_update_6000() {
     if (db_result(db_query("SELECT COUNT(*) FROM {book}"))) {
       // Temporary table for the old book hierarchy; we'll discard revision info.
       $schema['book_temp'] = array(
-        'fields' => array(
+        'columns' => array(
           'nid'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
           'parent' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
           'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
@@ -250,7 +250,7 @@ function book_update_6000() {
 function book_schema() {
   $schema['book'] = array(
   'description' => t('Stores book outline information. Uniquely connects each node in the outline to a link in {menu_links}'),
-    'fields' => array(
+    'columns' => array(
       'mlid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.8
diff -u -F^f -r1.8 comment.install
--- modules/comment/comment.install	4 Nov 2007 14:33:06 -0000	1.8
+++ modules/comment/comment.install	7 Nov 2007 15:09:41 -0000
@@ -63,7 +63,7 @@ function comment_update_6002() {
 function comment_schema() {
   $schema['comments'] = array(
     'description' => t('Stores comments and associated data.'),
-    'fields' => array(
+    'columns' => array(
       'cid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -162,7 +162,7 @@ function comment_schema() {
 
     $schema['node_comment_statistics'] = array(
      'description' => t('Maintains statistics of node and comments posts to show "new" and "updated" flags.'),
-      'fields' => array(
+      'columns' => array(
        'nid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
Index: modules/contact/contact.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v
retrieving revision 1.9
diff -u -F^f -r1.9 contact.install
--- modules/contact/contact.install	10 Oct 2007 11:39:32 -0000	1.9
+++ modules/contact/contact.install	7 Nov 2007 15:09:41 -0000
@@ -27,7 +27,7 @@ function contact_uninstall() {
 function contact_schema() {
   $schema['contact'] = array(
     'description' => t('Contact form category settings.'),
-    'fields' => array(
+    'columns' => array(
       'cid' => array(
         'type' => 'serial',
         'unsigned' => TRUE,
Index: modules/dblog/dblog.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.install,v
retrieving revision 1.6
diff -u -F^f -r1.6 dblog.install
--- modules/dblog/dblog.install	4 Nov 2007 14:33:06 -0000	1.6
+++ modules/dblog/dblog.install	7 Nov 2007 15:09:41 -0000
@@ -23,7 +23,7 @@ function dblog_uninstall() {
 function dblog_schema() {
   $schema['watchdog'] = array(
     'description' => t('Table that contains logs of all system events.'),
-    'fields' => array(
+    'columns' => array(
       'wid' => array(
         'type' => 'serial',
         'not null' => TRUE,
Index: modules/filter/filter.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.install,v
retrieving revision 1.3
diff -u -F^f -r1.3 filter.install
--- modules/filter/filter.install	4 Nov 2007 14:33:06 -0000	1.3
+++ modules/filter/filter.install	7 Nov 2007 15:09:41 -0000
@@ -7,7 +7,7 @@
 function filter_schema() {
   $schema['filters'] = array(
     'description' => t('Table that maps filters (HTML corrector) to input formats (Filtered HTML).'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -46,7 +46,7 @@ function filter_schema() {
   );
   $schema['filter_formats'] = array(
     'description' => t('Stores input formats: custom groupings of filters, such as Filtered HTML.'),
-    'fields' => array(
+    'columns' => array(
       'format' => array(
         'type' => 'serial',
         'not null' => TRUE,
Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.11
diff -u -F^f -r1.11 forum.install
--- modules/forum/forum.install	10 Oct 2007 11:39:33 -0000	1.11
+++ modules/forum/forum.install	7 Nov 2007 15:09:41 -0000
@@ -57,7 +57,7 @@ function forum_uninstall() {
 function forum_schema() {
   $schema['forum'] = array(
     'description' => t('Stores the relationship of nodes to forum terms.'),
-    'fields' => array(
+    'columns' => array(
       'nid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.20
diff -u -F^f -r1.20 locale.install
--- modules/locale/locale.install	21 Oct 2007 18:59:02 -0000	1.20
+++ modules/locale/locale.install	7 Nov 2007 15:09:42 -0000
@@ -140,7 +140,7 @@ function locale_uninstall() {
 function locale_schema() {
   $schema['languages'] = array(
     'description' => t('List of all available languages in the system.'),
-    'fields' => array(
+    'columns' => array(
       'language' => array(
         'type' => 'varchar',
         'length' => 12,
@@ -220,7 +220,7 @@ function locale_schema() {
 
   $schema['locales_source'] = array(
     'description' => t('List of English source strings.'),
-    'fields' => array(
+    'columns' => array(
       'lid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -261,7 +261,7 @@ function locale_schema() {
 
   $schema['locales_target'] = array(
     'description' => t('Stores translated versions of strings.'),
-    'fields' => array(
+    'columns' => array(
       'lid' => array(
         'type' => 'int',
         'not null' => TRUE,
Index: modules/menu/menu.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.install,v
retrieving revision 1.8
diff -u -F^f -r1.8 menu.install
--- modules/menu/menu.install	10 Oct 2007 11:39:33 -0000	1.8
+++ modules/menu/menu.install	7 Nov 2007 15:09:42 -0000
@@ -27,7 +27,7 @@ function menu_uninstall() {
 function menu_schema() {
   $schema['menu_custom'] = array(
     'description' => t('Holds definitions for top-level custom menus (for example, Primary Links).'),
-    'fields' => array(
+    'columns' => array(
       'menu_name' => array(
         'type' => 'varchar',
         'length' => 32,
Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.3
diff -u -F^f -r1.3 node.install
--- modules/node/node.install	4 Nov 2007 14:33:07 -0000	1.3
+++ modules/node/node.install	7 Nov 2007 15:09:42 -0000
@@ -7,7 +7,7 @@
 function node_schema() {
   $schema['node'] = array(
     'description' => t('The base table for nodes.'),
-    'fields' => array(
+    'columns' => array(
       'nid' => array(
         'description' => t('The primary identifier for a node.'),
         'type' => 'serial',
@@ -111,7 +111,7 @@ function node_schema() {
 
   $schema['node_access'] = array(
     'description' => t('Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.'),
-    'fields' => array(
+    'columns' => array(
       'nid' => array(
         'description' => t('The {node}.nid this record affects.'),
         'type' => 'int',
@@ -157,7 +157,7 @@ function node_schema() {
 
   $schema['node_counter'] = array(
     'description' => t('Access statistics for {node}s.'),
-    'fields' => array(
+    'columns' => array(
       'nid' => array(
         'description' => t('The {node}.nid for these statistics.'),
         'type' => 'int',
@@ -189,7 +189,7 @@ function node_schema() {
 
   $schema['node_revisions'] = array(
     'description' => t('Stores information about each saved version of a {node}.'),
-    'fields' => array(
+    'columns' => array(
       'nid' => array(
         'description' => t('The {node} this version belongs to.'),
         'type' => 'int',
@@ -247,7 +247,7 @@ function node_schema() {
 
   $schema['node_type'] = array(
     'description' => t('Stores information about all defined {node} types.'),
-    'fields' => array(
+    'columns' => array(
       'type' => array(
         'description' => t('The machine-readable name of this type.'),
         'type' => 'varchar',
Index: modules/openid/openid.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.install,v
retrieving revision 1.3
diff -u -F^f -r1.3 openid.install
--- modules/openid/openid.install	10 Oct 2007 11:39:33 -0000	1.3
+++ modules/openid/openid.install	7 Nov 2007 15:09:42 -0000
@@ -23,7 +23,7 @@ function openid_uninstall() {
 function openid_schema() {
   $schema['openid_association'] = array(
     'description' => t('Stores temporary shared key association information for OpenID authentication.'),
-    'fields' => array(
+    'columns' => array(
       'idp_endpoint_uri' => array(
         'type' => 'varchar',
         'length' => 255,
Index: modules/poll/poll.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.install,v
retrieving revision 1.12
diff -u -F^f -r1.12 poll.install
--- modules/poll/poll.install	21 Oct 2007 18:59:02 -0000	1.12
+++ modules/poll/poll.install	7 Nov 2007 15:09:42 -0000
@@ -23,7 +23,7 @@ function poll_uninstall() {
 function poll_schema() {
   $schema['poll'] = array(
     'description' => t('Stores poll-specific information for poll nodes.'),
-    'fields' => array(
+    'columns' => array(
       'nid'     => array(
         'type' => 'int',
         'unsigned' => TRUE,
@@ -50,7 +50,7 @@ function poll_schema() {
 
   $schema['poll_choices'] = array(
     'description' => t('Stores information about all choices for all {poll}s.'),
-    'fields' => array(
+    'columns' => array(
       'chid'    => array(
         'type' => 'serial',
         'unsigned' => TRUE,
@@ -92,7 +92,7 @@ function poll_schema() {
 
   $schema['poll_votes'] = array(
     'description' => t('Stores per-{users} votes for each {poll}.'),
-    'fields' => array(
+    'columns' => array(
       'nid'      => array(
         'type' => 'int',
         'unsigned' => TRUE,
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.11
diff -u -F^f -r1.11 profile.install
--- modules/profile/profile.install	10 Oct 2007 11:39:33 -0000	1.11
+++ modules/profile/profile.install	7 Nov 2007 15:09:42 -0000
@@ -25,7 +25,7 @@ function profile_uninstall() {
 function profile_schema() {
   $schema['profile_fields'] = array(
     'description' => t('Stores profile field information.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -115,7 +115,7 @@ function profile_schema() {
 
   $schema['profile_values'] = array(
     'description' => t('Stores values for profile fields.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
Index: modules/search/search.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.install,v
retrieving revision 1.10
diff -u -F^f -r1.10 search.install
--- modules/search/search.install	10 Oct 2007 11:39:34 -0000	1.10
+++ modules/search/search.install	7 Nov 2007 15:09:42 -0000
@@ -27,7 +27,7 @@ function search_uninstall() {
 function search_schema() {
   $schema['search_dataset'] = array(
     'description' => t('Stores items that will be searched.'),
-    'fields' => array(
+    'columns' => array(
       'sid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
@@ -53,7 +53,7 @@ function search_schema() {
 
   $schema['search_index'] = array(
     'description' => t('Stores the search index, associating words, items and scores.'),
-    'fields' => array(
+    'columns' => array(
       'word' => array(
         'type' => 'varchar',
         'length' => 50,
@@ -102,7 +102,7 @@ function search_schema() {
 
   $schema['search_total'] = array(
     'description' => t('Stores search totals for words.'),
-    'fields' => array(
+    'columns' => array(
       'word' => array(
         'description' => t('Primary Key: Unique word in the search index.'),
         'type' => 'varchar',
Index: modules/statistics/statistics.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.install,v
retrieving revision 1.12
diff -u -F^f -r1.12 statistics.install
--- modules/statistics/statistics.install	4 Nov 2007 14:33:07 -0000	1.12
+++ modules/statistics/statistics.install	7 Nov 2007 15:09:42 -0000
@@ -50,7 +50,7 @@ function statistics_uninstall() {
 function statistics_schema() {
   $schema['accesslog'] = array(
     'description' => t('Stores site access information for statistics.'),
-    'fields' => array(
+    'columns' => array(
       'aid' => array(
         'type' => 'serial',
         'not null' => TRUE,
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.173
diff -u -F^f -r1.173 system.install
--- modules/system/system.install	7 Nov 2007 09:55:20 -0000	1.173
+++ modules/system/system.install	7 Nov 2007 15:09:44 -0000
@@ -324,7 +324,7 @@ function system_schema() {
   // and variable_set() for overcoming some database specific limitations.
   $schema['variable'] = array(
     'description' => t('Named variable/value pairs created by Drupal core or any other module or theme.  All variables are cached in memory at the start of every Drupal request so developers should not be careless about what is stored here.'),
-    'fields' => array(
+    'columns' => array(
       'name' => array(
         'description' => t('The name of the variable.'),
         'type' => 'varchar',
@@ -342,7 +342,7 @@ function system_schema() {
 
   $schema['actions'] = array(
     'description' => t('Stores action information.'),
-    'fields' => array(
+    'columns' => array(
       'aid' => array(
         'description' => t('Primary Key: Unique actions ID.'),
         'type' => 'varchar',
@@ -378,7 +378,7 @@ function system_schema() {
 
   $schema['actions_aid'] = array(
     'description' => t('Stores action IDs for non-default actions.'),
-    'fields' => array(
+    'columns' => array(
       'aid' => array(
         'description' => t('Primary Key: Unique actions ID.'),
         'type' => 'serial',
@@ -390,7 +390,7 @@ function system_schema() {
 
   $schema['batch'] = array(
     'description' => t('Stores details about batches (processes that run in multiple HTTP requests).'),
-    'fields' => array(
+    'columns' => array(
       'bid' => array(
         'description' => t('Primary Key: Unique batch ID.'),
         'type' => 'serial',
@@ -417,7 +417,7 @@ function system_schema() {
 
   $schema['cache'] = array(
     'description' => t('Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.'),
-    'fields' => array(
+    'columns' => array(
       'cid' => array(
         'description' => t('Primary Key: Unique cache ID.'),
         'type' => 'varchar',
@@ -463,7 +463,7 @@ function system_schema() {
 
   $schema['files'] = array(
     'description' => t('Stores information for uploaded files.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'description' => t('Primary Key: Unique files ID.'),
         'type' => 'serial',
@@ -521,7 +521,7 @@ function system_schema() {
 
   $schema['flood'] = array(
     'description' => t('Flood controls the threshold of events, such as the number of contact attempts.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'description' => t('Unique flood event ID.'),
         'type' => 'serial',
@@ -549,7 +549,7 @@ function system_schema() {
 
   $schema['history'] = array(
     'description' => t('A record of which {users} have read which {node}s.'),
-    'fields' => array(
+    'columns' => array(
       'uid' => array(
         'description' => t('The {users}.uid that read the {node} nid.'),
         'type' => 'int',
@@ -570,7 +570,7 @@ function system_schema() {
     );
   $schema['menu_router'] = array(
     'description' => t('Maps paths to various callbacks (access, page and title)'),
-    'fields' => array(
+    'columns' => array(
       'path' => array(
         'description' => t('Primary Key: the Drupal path this entry describes'),
         'type' => 'varchar',
@@ -690,7 +690,7 @@ function system_schema() {
 
   $schema['menu_links'] = array(
     'description' => t('Contains the individual links within a menu.'),
-    'fields' => array(
+    'columns' => array(
      'menu_name' => array(
         'description' => t("The menu name. All links with the same menu name (such as 'navigation') are part of the same menu."),
         'type' => 'varchar',
@@ -851,7 +851,7 @@ function system_schema() {
 
   $schema['sessions'] = array(
     'description' => t("Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated."),
-    'fields' => array(
+    'columns' => array(
       'uid' => array(
         'description' => t('The {users}.uid corresponding to a session, or 0 for anonymous user.'),
         'type' => 'int',
@@ -894,7 +894,7 @@ function system_schema() {
 
   $schema['system'] = array(
     'description' => t("A list of all modules, themes, and theme engines that are or have been installed in Drupal's file system."),
-    'fields' => array(
+    'columns' => array(
       'filename' => array(
         'description' => t('The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.'),
         'type' => 'varchar',
@@ -961,7 +961,7 @@ function system_schema() {
 
   $schema['url_alias'] = array(
     'description' => t('A list of URL aliases for Drupal paths; a user may visit either the source or destination path.'),
-    'fields' => array(
+    'columns' => array(
       'pid' => array(
         'description' => t('A unique path alias identifier.'),
         'type' => 'serial',
@@ -1442,7 +1442,7 @@ function system_update_129() {
     $ret[] = update_sql("ALTER TABLE {vocabulary} ADD tags tinyint unsigned default '0' NOT NULL");
   }
   elseif ($GLOBALS['db_type'] == 'pgsql') {
-    db_add_column($ret, 'vocabulary', 'tags', 'smallint', array('default' => 0, 'not null' => TRUE));
+    db_old_add_column($ret, 'vocabulary', 'tags', 'smallint', array('default' => 0, 'not null' => TRUE));
   }
 
   return $ret;
@@ -1513,7 +1513,7 @@ function system_update_133() {
     // Table {contact} is changed in update_143() so I have moved it's creation there.
     // It was never created here for postgres because of errors.
 
-    db_add_column($ret, 'users', 'login', 'int', array('default' => 0, 'not null' => TRUE));
+    db_old_add_column($ret, 'users', 'login', 'int', array('default' => 0, 'not null' => TRUE));
   }
 
   return $ret;
@@ -1566,7 +1566,7 @@ function system_update_137() {
       $ret[] = update_sql("ALTER TABLE {locales_source} CHANGE location location varchar(255) NOT NULL default ''");
     }
     elseif ($GLOBALS['db_type'] == 'pgsql') {
-      db_change_column($ret, 'locales_source', 'location', 'location', 'varchar(255)', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'locales_source', 'location', 'location', 'varchar(255)', array('not null' => TRUE, 'default' => "''"));
     }
     variable_del('update_137_done');
   }
@@ -1585,7 +1585,7 @@ function system_update_139() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_add_column($ret, 'accesslog', 'timer', 'int', array('not null' => TRUE, 'default' => 0));
+      db_old_add_column($ret, 'accesslog', 'timer', 'int', array('not null' => TRUE, 'default' => 0));
       break;
     case 'mysql':
     case 'mysqli':
@@ -1652,7 +1652,7 @@ function system_update_144() {
   elseif ($GLOBALS['db_type'] == 'pgsql') {
     $ret[] = update_sql("DROP INDEX {node}_type_idx"); // Drop indexes using "type" column
     $ret[] = update_sql("DROP INDEX {node}_title_idx");
-    db_change_column($ret, 'node', 'type', 'type', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
+    db_old_change_column($ret, 'node', 'type', 'type', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
     // Let's recreate the indexes
     $ret[] = update_sql("CREATE INDEX {node}_type_idx ON {node}(type)");
     $ret[] = update_sql("CREATE INDEX {node}_title_type_idx ON {node}(title,type)");
@@ -1674,8 +1674,8 @@ function system_update_145() {
 
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_change_column($ret, 'blocks', 'region', 'region', 'varchar(64)', array('default' => "'left'", 'not null' => TRUE));
-      db_add_column($ret, 'blocks', 'theme', 'varchar(255)', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'blocks', 'region', 'region', 'varchar(64)', array('default' => "'left'", 'not null' => TRUE));
+      db_old_add_column($ret, 'blocks', 'theme', 'varchar(255)', array('not null' => TRUE, 'default' => "''"));
       break;
     case 'mysql':
     case 'mysqli':
@@ -1760,10 +1760,10 @@ function system_update_146() {
     $vid = db_next_id('{node}_nid');
     $ret[] = update_sql("CREATE SEQUENCE {node_revisions}_vid_seq INCREMENT 1 START $vid");
 
-    db_add_column($ret, 'node',  'vid', 'int', array('not null' => TRUE, 'default' => 0));
-    db_add_column($ret, 'files', 'vid', 'int', array('not null' => TRUE, 'default' => 0));
-    db_add_column($ret, 'book',  'vid', 'int', array('not null' => TRUE, 'default' => 0));
-    db_add_column($ret, 'forum', 'vid', 'int', array('not null' => TRUE, 'default' => 0));
+    db_old_add_column($ret, 'node',  'vid', 'int', array('not null' => TRUE, 'default' => 0));
+    db_old_add_column($ret, 'files', 'vid', 'int', array('not null' => TRUE, 'default' => 0));
+    db_old_add_column($ret, 'book',  'vid', 'int', array('not null' => TRUE, 'default' => 0));
+    db_old_add_column($ret, 'forum', 'vid', 'int', array('not null' => TRUE, 'default' => 0));
 
     $ret[] = update_sql("ALTER TABLE {book} DROP CONSTRAINT {book}_pkey");
     $ret[] = update_sql("ALTER TABLE {forum} DROP CONSTRAINT {forum}_pkey");
@@ -1817,7 +1817,7 @@ function system_update_148() {
   // Add support for tracking users' session ids (useful for tracking anon users)
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_add_column($ret, 'accesslog', 'sid', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
+      db_old_add_column($ret, 'accesslog', 'sid', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
       break;
     case 'mysql':
     case 'mysqli':
@@ -1833,7 +1833,7 @@ function system_update_149() {
 
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_add_column($ret, 'files', 'description', 'varchar(255)', array('not null' => TRUE, 'default' => "''"));
+      db_old_add_column($ret, 'files', 'description', 'varchar(255)', array('not null' => TRUE, 'default' => "''"));
       break;
     case 'mysql':
     case 'mysqli':
@@ -2037,7 +2037,7 @@ function system_update_153() {
     case 'pgsql':
       $ret[] = update_sql("ALTER TABLE {contact} DROP CONSTRAINT {contact}_pkey");
       $ret[] = update_sql("CREATE SEQUENCE {contact}_cid_seq");
-      db_add_column($ret, 'contact', 'cid', 'int', array('not null' => TRUE, 'default' => "nextval('{contact}_cid_seq')"));
+      db_old_add_column($ret, 'contact', 'cid', 'int', array('not null' => TRUE, 'default' => "nextval('{contact}_cid_seq')"));
       $ret[] = update_sql("ALTER TABLE {contact} ADD PRIMARY KEY (cid)");
       $ret[] = update_sql("ALTER TABLE {contact} ADD CONSTRAINT {contact}_category_key UNIQUE (category)");
       break;
@@ -2055,8 +2055,8 @@ function system_update_154() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_add_column($ret, 'contact', 'weight', 'smallint', array('not null' => TRUE, 'default' => 0));
-      db_add_column($ret, 'contact', 'selected', 'smallint', array('not null' => TRUE, 'default' => 0));
+      db_old_add_column($ret, 'contact', 'weight', 'smallint', array('not null' => TRUE, 'default' => 0));
+      db_old_add_column($ret, 'contact', 'selected', 'smallint', array('not null' => TRUE, 'default' => 0));
       break;
     case 'mysql':
     case 'mysqli':
@@ -2117,7 +2117,7 @@ function system_update_158() {
       break;
 
     case 'pgsql':
-      db_add_column($ret, 'old_revisions', 'done', 'smallint', array('not null' => TRUE, 'default' => 0));
+      db_old_add_column($ret, 'old_revisions', 'done', 'smallint', array('not null' => TRUE, 'default' => 0));
       $ret[] = update_sql('CREATE INDEX {old_revisions}_done_idx ON {old_revisions}(done)');
       break;
   }
@@ -2291,11 +2291,11 @@ function system_update_162() {
 
       $ret[] = update_sql('ALTER TABLE {accesslog} DROP mask');
 
-      db_change_column($ret, 'accesslog', 'path', 'path', 'text');
-      db_change_column($ret, 'accesslog', 'url', 'url', 'text');
-      db_change_column($ret, 'watchdog', 'link', 'link', 'text', array('not null' => TRUE, 'default' => "''"));
-      db_change_column($ret, 'watchdog', 'location', 'location', 'text', array('not null' => TRUE, 'default' => "''"));
-      db_change_column($ret, 'watchdog', 'referer', 'referer', 'text', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'accesslog', 'path', 'path', 'text');
+      db_old_change_column($ret, 'accesslog', 'url', 'url', 'text');
+      db_old_change_column($ret, 'watchdog', 'link', 'link', 'text', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'watchdog', 'location', 'location', 'text', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'watchdog', 'referer', 'referer', 'text', array('not null' => TRUE, 'default' => "''"));
 
       break;
   }
@@ -2431,7 +2431,7 @@ function system_update_167() {
       $ret[] = update_sql("ALTER TABLE {vocabulary_node_types} CHANGE type type varchar(32) NOT NULL default ''");
       break;
     case 'pgsql':
-      db_change_column($ret, 'vocabulary_node_types', 'type', 'type', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'vocabulary_node_types', 'type', 'type', 'varchar(32)', array('not null' => TRUE, 'default' => "''"));
       $ret[] = update_sql("ALTER TABLE {vocabulary_node_types} ADD PRIMARY KEY (vid, type)");
       break;
   }
@@ -2482,7 +2482,7 @@ function system_update_170() {
     switch ($GLOBALS['db_type']) {
       case 'pgsql':
         $ret = array();
-        db_change_column($ret, 'system', 'schema_version', 'schema_version', 'smallint', array('not null' => TRUE, 'default' => -1));
+        db_old_change_column($ret, 'system', 'schema_version', 'schema_version', 'smallint', array('not null' => TRUE, 'default' => -1));
         break;
 
       case 'mysql':
@@ -2940,7 +2940,7 @@ function system_update_181() {
       $ret[] = update_sql("ALTER TABLE {profile_fields} ADD autocomplete TINYint NOT NULL AFTER visibility");
       break;
     case 'pgsql':
-      db_add_column($ret, 'profile_fields', 'autocomplete', 'smallint', array('not null' => TRUE, 'default' => 0));
+      db_old_add_column($ret, 'profile_fields', 'autocomplete', 'smallint', array('not null' => TRUE, 'default' => 0));
       break;
   }
   return $ret;
@@ -3003,7 +3003,7 @@ function system_update_1001() {
       break;
 
     case 'pgsql':
-      db_add_column($ret, 'poll_votes', 'chorder', 'int', array('not null' => TRUE, 'default' => "'-1'"));
+      db_old_add_column($ret, 'poll_votes', 'chorder', 'int', array('not null' => TRUE, 'default' => "'-1'"));
       break;
   }
 
@@ -3030,7 +3030,7 @@ function system_update_1003() {
       $ret[] = update_sql("ALTER TABLE {aggregator_item} ADD guid varchar(255) AFTER timestamp ;");
       break;
     case 'pgsql':
-      db_add_column($ret, 'aggregator_item', 'guid', 'varchar(255)');
+      db_old_add_column($ret, 'aggregator_item', 'guid', 'varchar(255)');
       break;
   }
   return $ret;
@@ -3181,7 +3181,7 @@ function system_update_1006() {
     $ret[] = update_sql("ALTER TABLE {blocks} ADD title VARCHAR(64) NOT NULL DEFAULT ''");
       break;
     case 'pgsql':
-      db_add_column($ret, 'blocks', 'title', 'varchar(64)', array('default' => "''", 'not null' => TRUE));
+      db_old_add_column($ret, 'blocks', 'title', 'varchar(64)', array('default' => "''", 'not null' => TRUE));
       break;
   }
   // Migrate custom block titles to new column.
@@ -3276,7 +3276,7 @@ function system_update_1013() {
       $ret[] = update_sql("ALTER TABLE {sessions} CHANGE COLUMN sid sid varchar(64) NOT NULL default ''");
       break;
     case 'pgsql':
-      db_change_column($ret, 'sessions', 'sid', 'sid', 'varchar(64)',  array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'sessions', 'sid', 'sid', 'varchar(64)',  array('not null' => TRUE, 'default' => "''"));
       break;
   }
   return $ret;
@@ -3315,7 +3315,7 @@ function system_update_1016() {
       $ret[] = update_sql("ALTER TABLE {watchdog} CHANGE COLUMN location location text NOT NULL");
       break;
     case 'pgsql':
-      db_change_column($ret, 'watchdog', 'location', 'location', 'text',  array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'watchdog', 'location', 'location', 'text',  array('not null' => TRUE, 'default' => "''"));
       break;
   }
   return $ret;
@@ -3328,7 +3328,7 @@ function system_update_1017() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_change_column($ret, 'role', 'name', 'name', 'varchar(64)', array('not null' => TRUE, 'default' => "''"));
+      db_old_change_column($ret, 'role', 'name', 'name', 'varchar(64)', array('not null' => TRUE, 'default' => "''"));
       break;
     case 'mysql':
     case 'mysqli':
@@ -3454,7 +3454,7 @@ function system_update_6001() {
   $ret = array();
 
   // Add vid to term-node relation.  The schema says it is unsigned.
-  db_add_field($ret, 'term_node', 'vid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_add_column($ret, 'term_node', 'vid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
   db_drop_primary_key($ret, 'term_node');
   db_add_primary_key($ret, 'term_node', array('vid', 'tid', 'nid'));
   db_add_index($ret, 'term_node', 'vid', array('vid'));
@@ -3473,7 +3473,7 @@ function system_update_6001() {
 function system_update_6002() {
   $ret = array();
   db_drop_primary_key($ret, 'variable');
-  db_change_field($ret, 'variable', 'name', 'name', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
+  db_change_column($ret, 'variable', 'name', 'name', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
   db_add_primary_key($ret, 'variable', array('name'));
   return $ret;
 }
@@ -3518,7 +3518,7 @@ function system_update_6005() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_add_column($ret, 'url_alias', 'language', 'varchar(12)', array('default' => "''", 'not null' => TRUE));
+      db_old_add_column($ret, 'url_alias', 'language', 'varchar(12)', array('default' => "''", 'not null' => TRUE));
 
       // As of system.install:1.85 (before the new language
       // subsystem), new installs got a unique key named
@@ -3600,7 +3600,7 @@ function system_update_6007() {
 function system_update_6008() {
   $ret = array();
   $ret[] = update_sql('UPDATE {system} SET owner = description');
-  db_drop_field($ret, 'system', 'description');
+  db_drop_column($ret, 'system', 'description');
 
   // Rebuild system table contents.
   module_rebuild_cache();
@@ -3653,7 +3653,7 @@ function system_update_6009() {
  */
 function system_update_6010() {
   $ret = array();
-  db_add_field($ret, 'watchdog', 'variables', array('type' => 'text', 'size' => 'big', 'not null' => TRUE, 'initial' => 'N;'));
+  db_add_column($ret, 'watchdog', 'variables', array('type' => 'text', 'size' => 'big', 'not null' => TRUE, 'initial' => 'N;'));
   return $ret;
 }
 
@@ -3664,7 +3664,7 @@ function system_update_6011() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      db_add_column($ret, 'node', 'language', 'varchar(12)', array('default' => "''", 'not null' => TRUE));
+      db_old_add_column($ret, 'node', 'language', 'varchar(12)', array('default' => "''", 'not null' => TRUE));
       break;
     case 'mysql':
     case 'mysqli':
@@ -3750,17 +3750,17 @@ function system_update_6016() {
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
       $ret[] = update_sql("ALTER TABLE {node} ADD CONSTRAINT {node}_nid_vid_key UNIQUE (nid, vid)");
-      db_add_column($ret, 'blocks', 'bid', 'serial');
+      db_old_add_column($ret, 'blocks', 'bid', 'serial');
       $ret[] = update_sql("ALTER TABLE {blocks} ADD PRIMARY KEY (bid)");
-      db_add_column($ret, 'filters', 'fid', 'serial');
+      db_old_add_column($ret, 'filters', 'fid', 'serial');
       $ret[] = update_sql("ALTER TABLE {filters} ADD PRIMARY KEY (fid)");
-      db_add_column($ret, 'flood', 'fid', 'serial');
+      db_old_add_column($ret, 'flood', 'fid', 'serial');
       $ret[] = update_sql("ALTER TABLE {flood} ADD PRIMARY KEY (fid)");
-      db_add_column($ret, 'permission', 'pid', 'serial');
+      db_old_add_column($ret, 'permission', 'pid', 'serial');
       $ret[] = update_sql("ALTER TABLE {permission} ADD PRIMARY KEY (pid)");
-      db_add_column($ret, 'term_relation', 'trid', 'serial');
+      db_old_add_column($ret, 'term_relation', 'trid', 'serial');
       $ret[] = update_sql("ALTER TABLE {term_relation} ADD PRIMARY KEY (trid)");
-      db_add_column($ret, 'term_synonym', 'tsid', 'serial');
+      db_old_add_column($ret, 'term_synonym', 'tsid', 'serial');
       $ret[] = update_sql("ALTER TABLE {term_synonym} ADD PRIMARY KEY (tsid)");
       break;
     case 'mysql':
@@ -3853,26 +3853,26 @@ function system_update_6019() {
     case 'pgsql':
       // Remove default ''.
       if (db_table_exists('aggregator_feed')) {
-        db_field_set_no_default($ret, 'aggregator_feed', 'description');
-        db_field_set_no_default($ret, 'aggregator_feed', 'image');
+        db_column_set_no_default($ret, 'aggregator_feed', 'description');
+        db_column_set_no_default($ret, 'aggregator_feed', 'image');
       }
-      db_field_set_no_default($ret, 'blocks', 'pages');
+      db_column_set_no_default($ret, 'blocks', 'pages');
       if (db_table_exists('contact')) {
-        db_field_set_no_default($ret, 'contact', 'recipients');
-        db_field_set_no_default($ret, 'contact', 'reply');
+        db_column_set_no_default($ret, 'contact', 'recipients');
+        db_column_set_no_default($ret, 'contact', 'reply');
       }
-      db_field_set_no_default($ret, 'watchdog', 'location');
-      db_field_set_no_default($ret, 'node_revisions', 'body');
-      db_field_set_no_default($ret, 'node_revisions', 'teaser');
-      db_field_set_no_default($ret, 'node_revisions', 'log');
+      db_column_set_no_default($ret, 'watchdog', 'location');
+      db_column_set_no_default($ret, 'node_revisions', 'body');
+      db_column_set_no_default($ret, 'node_revisions', 'teaser');
+      db_column_set_no_default($ret, 'node_revisions', 'log');
 
       // Update from pgsql 'float' (which means 'double precision') to
       // schema 'float' (which in pgsql means 'real').
       if (db_table_exists('search_index')) {
-        db_change_field($ret, 'search_index', 'score', 'score', array('type' => 'float'));
+        db_change_column($ret, 'search_index', 'score', 'score', array('type' => 'float'));
       }
       if (db_table_exists('search_total')) {
-        db_change_field($ret, 'search_total', 'count', 'count', array('type' => 'float'));
+        db_change_column($ret, 'search_total', 'count', 'count', array('type' => 'float'));
       }
 
       // Replace unique index dst_language with a unique constraint.  The
@@ -3894,7 +3894,7 @@ function system_update_6019() {
 
       // Make boxes.bid unsigned.
       db_drop_primary_key($ret, 'boxes');
-      db_change_field($ret, 'boxes', 'bid', 'bid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('bid')));
+      db_change_column($ret, 'boxes', 'bid', 'bid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('bid')));
 
       // Fix primary key
       db_drop_primary_key($ret, 'node');
@@ -3912,28 +3912,28 @@ function system_update_6019() {
 
       // Change to size => small.
       if (db_table_exists('boxes')) {
-        db_change_field($ret, 'boxes', 'format', 'format', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
+        db_change_column($ret, 'boxes', 'format', 'format', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
       }
 
       // Change to size => small.
       // Rename index 'lid' to 'nid'.
       if (db_table_exists('comments')) {
-        db_change_field($ret, 'comments', 'format', 'format', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
+        db_change_column($ret, 'comments', 'format', 'format', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
         db_drop_index($ret, 'comments', 'lid');
         db_add_index($ret, 'comments', 'nid', array('nid'));
       }
 
       // Change to size => small.
-      db_change_field($ret, 'cache', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
-      db_change_field($ret, 'cache_filter', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
-      db_change_field($ret, 'cache_page', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
-      db_change_field($ret, 'cache_form', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
+      db_change_column($ret, 'cache', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
+      db_change_column($ret, 'cache_filter', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
+      db_change_column($ret, 'cache_page', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
+      db_change_column($ret, 'cache_form', 'serialized', 'serialized', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
 
       // Remove default => 0, set auto increment.
       $new_uid = 1 + db_result(db_query('SELECT MAX(uid) FROM {users}'));
       $ret[] = update_sql('UPDATE {users} SET uid = '. $new_uid .' WHERE uid = 0');
       db_drop_primary_key($ret, 'users');
-      db_change_field($ret, 'users', 'uid', 'uid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('uid')));
+      db_change_column($ret, 'users', 'uid', 'uid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('uid')));
       $ret[] = update_sql('UPDATE {users} SET uid = 0 WHERE uid = '. $new_uid);
 
       // Special field names.
@@ -3942,7 +3942,7 @@ function system_update_6019() {
       foreach (array('boxes', 'files', 'node', 'node_revisions') as $table) {
         $field = isset($map[$table]) ? $map[$table] : $table[0] .'id';
         db_drop_primary_key($ret, $table);
-        db_change_field($ret, $table, $field, $field, array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array($field)));
+        db_change_column($ret, $table, $field, $field, array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array($field)));
       }
 
       break;
@@ -3958,7 +3958,7 @@ function system_update_6020() {
   $ret = array();
 
   $schema['menu_router'] = array(
-    'fields' => array(
+    'columns' => array(
       'path'             => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
       'load_functions'   => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
       'to_arg_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
@@ -3988,7 +3988,7 @@ function system_update_6020() {
   );
 
   $schema['menu_links'] = array(
-    'fields' => array(
+    'columns' => array(
       'menu_name'    => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
       'mlid'         => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
       'plid'         => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
@@ -4037,7 +4037,7 @@ function system_update_6021() {
   $ret = array('#finished' => 0);
   // Multi-part update
   if (!isset($_SESSION['system_update_6021'])) {
-    db_add_field($ret, 'menu', 'converted', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'));
+    db_add_column($ret, 'menu', 'converted', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'));
     $_SESSION['system_update_6021_max'] = db_result(db_query('SELECT COUNT(*) FROM {menu}'));
     $_SESSION['menu_menu_map'] = array(1 => 'navigation');
     // 0 => FALSE is for new menus, 1 => FALSE is for the navigation.
@@ -4054,7 +4054,7 @@ function system_update_6021() {
       }
     }
     $table = array(
-      'fields' => array(
+      'columns' => array(
         'menu_name'   => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
         'title'       => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
         'description' => array('type' => 'text', 'not null' => FALSE),
@@ -4225,9 +4225,9 @@ function system_update_6022() {
 
   // Rename the nid field to vid, add status and timestamp fields, and indexes.
   db_drop_index($ret, 'files', 'nid');
-  db_change_field($ret, 'files', 'nid', 'uid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
-  db_add_field($ret, 'files', 'status', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
-  db_add_field($ret, 'files', 'timestamp', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_change_column($ret, 'files', 'nid', 'uid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_add_column($ret, 'files', 'status', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
+  db_add_column($ret, 'files', 'timestamp', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
   db_add_index($ret, 'files', 'uid', array('uid'));
   db_add_index($ret, 'files', 'status', array('status'));
   db_add_index($ret, 'files', 'timestamp', array('timestamp'));
@@ -4237,7 +4237,7 @@ function system_update_6022() {
   // pgsql ends up with the correct index name.
   db_drop_index($ret, 'file_revisions', 'vid');
   db_rename_table($ret, 'file_revisions', 'upload');
-  db_add_field($ret, 'upload', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_add_column($ret, 'upload', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
   db_add_index($ret, 'upload', 'nid', array('nid'));
   db_add_index($ret, 'upload', 'vid', array('vid'));
 
@@ -4256,7 +4256,7 @@ function system_update_6023() {
 
   // nid is DEFAULT 0
   db_drop_index($ret, 'node_revisions', 'nid');
-  db_change_field($ret, 'node_revisions', 'nid', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_change_column($ret, 'node_revisions', 'nid', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
   db_add_index($ret, 'node_revisions', 'nid', array('nid'));
   return $ret;
 }
@@ -4266,8 +4266,8 @@ function system_update_6023() {
  */
 function system_update_6024() {
   $ret = array();
-  db_add_field($ret, 'node', 'tnid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
-  db_add_field($ret, 'node', 'translate', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
+  db_add_column($ret, 'node', 'tnid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_add_column($ret, 'node', 'translate', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
   db_add_index($ret, 'node', 'tnid', array('tnid'));
   db_add_index($ret, 'node', 'translate', array('translate'));
   return $ret;
@@ -4279,9 +4279,9 @@ function system_update_6024() {
 function system_update_6025() {
   $ret = array();
   db_drop_index($ret, 'node', 'node_title_type');
-  db_change_field($ret, 'node', 'title', 'title', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_column($ret, 'node', 'title', 'title', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
   db_add_index($ret, 'node', 'node_title_type', array('title', array('type', 4)));
-  db_change_field($ret, 'node_revisions', 'title', 'title', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
+  db_change_column($ret, 'node_revisions', 'title', 'title', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
   return $ret;
 }
 
@@ -4304,7 +4304,7 @@ function system_update_6027() {
   $ret = array();
 
   // Create the blocks.cache column.
-  db_add_field($ret, 'blocks', 'cache', array('type' => 'int', 'not null' => TRUE, 'default' => 1, 'size' => 'tiny'));
+  db_add_column($ret, 'blocks', 'cache', array('type' => 'int', 'not null' => TRUE, 'default' => 1, 'size' => 'tiny'));
 
   // The cache_block table is created in update_fix_d6_requirements() since
   // calls to cache_clear_all() would otherwise cause warnings.
@@ -4367,7 +4367,7 @@ function system_update_6029() {
 function system_update_6030() {
   $ret = array();
   $schema['actions'] = array(
-    'fields' => array(
+    'columns' => array(
       'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'),
       'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
       'callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
@@ -4378,7 +4378,7 @@ function system_update_6030() {
   );
 
   $schema['actions_aid'] = array(
-    'fields' => array(
+    'columns' => array(
       'aid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
     ),
     'primary key' => array('aid'),
@@ -4406,7 +4406,7 @@ function system_update_6032() {
   $ret = array();
   if (db_table_exists('profile_fields')) {
     db_drop_unique_key($ret, 'profile_fields', 'name');
-    db_change_field($ret, 'profile_fields', 'name', 'name', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
+    db_change_column($ret, 'profile_fields', 'name', 'name', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
     db_add_unique_key($ret, 'profile_fields', 'name', array('name'));
   }
   return $ret;
@@ -4418,23 +4418,7 @@ function system_update_6032() {
 function system_update_6033() {
   $ret = array();
   if (db_table_exists('node_comment_statistics')) {
-    // On pgsql but not mysql, db_change_field() drops all keys
-    // involving the changed field, which in this case is the primary
-    // key.  The normal approach is explicitly drop the pkey, change the
-    // field, and re-create the pkey.
-    //
-    // Unfortunately, in this case that won't work on mysql; we CANNOT
-    // drop the pkey because on mysql auto-increment fields must be
-    // included in at least one key or index.
-    //
-    // Since we cannot drop the pkey before db_change_field(), after
-    // db_change_field() we may or may not still have a pkey.  The
-    // simple way out is to re-create the pkey only when using pgsql.
-    // Realistic requirements trump idealistic purity.
-    db_change_field($ret, 'node_comment_statistics', 'nid', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
-    if ($GLOBALS['db_type'] == 'pgsql') {
-      db_add_primary_key($ret, 'node_comment_statistics', array('nid'));
-    }
+    db_change_column($ret, 'node_comment_statistics', 'nid', 'nid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
   }
   return $ret;
 }
Index: modules/taxonomy/taxonomy.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 taxonomy.install
--- modules/taxonomy/taxonomy.install	21 Oct 2007 18:59:02 -0000	1.4
+++ modules/taxonomy/taxonomy.install	7 Nov 2007 15:09:44 -0000
@@ -7,7 +7,7 @@
 function taxonomy_schema() {
   $schema['term_data'] = array(
     'description' => t('Stores term information.'),
-    'fields' => array(
+    'columns' => array(
       'tid' => array(
         'type' => 'serial',
         'unsigned' => TRUE,
@@ -48,7 +48,7 @@ function taxonomy_schema() {
 
   $schema['term_hierarchy'] = array(
     'description' => t('Stores the hierarchical relationship between terms.'),
-    'fields' => array(
+    'columns' => array(
       'tid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
@@ -73,7 +73,7 @@ function taxonomy_schema() {
 
   $schema['term_node'] = array(
     'description' => t('Stores the relationship of terms to nodes.'),
-    'fields' => array(
+    'columns' => array(
       'nid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
@@ -106,7 +106,7 @@ function taxonomy_schema() {
 
   $schema['term_relation'] = array(
     'description' => t('Stores non-hierarchical relationships between terms.'),
-    'fields' => array(
+    'columns' => array(
       'trid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -136,7 +136,7 @@ function taxonomy_schema() {
 
   $schema['term_synonym'] = array(
     'description' => t('Stores term synonyms.'),
-    'fields' => array(
+    'columns' => array(
       'tsid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -166,7 +166,7 @@ function taxonomy_schema() {
 
   $schema['vocabulary'] = array(
     'description' => t('Stores vocabulary information.'),
-    'fields' => array(
+    'columns' => array(
       'vid' => array(
         'type' => 'serial',
         'unsigned' => TRUE,
@@ -253,7 +253,7 @@ function taxonomy_schema() {
 
   $schema['vocabulary_node_types'] = array(
     'description' => t('Stores which node types vocabularies may be used with.'),
-    'fields' => array(
+    'columns' => array(
       'vid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
Index: modules/trigger/trigger.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 trigger.install
--- modules/trigger/trigger.install	4 Nov 2007 14:33:07 -0000	1.4
+++ modules/trigger/trigger.install	7 Nov 2007 15:09:44 -0000
@@ -26,7 +26,7 @@ function trigger_uninstall() {
 function trigger_schema() {
   $schema['trigger_assignments'] = array(
     'description' => t('Maps trigger to hook and operation assignments from trigger.module.'),
-    'fields' => array(
+    'columns' => array(
        'hook' => array(
          'type' => 'varchar',
          'length' => 32,
Index: modules/upload/upload.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.install,v
retrieving revision 1.4
diff -u -F^f -r1.4 upload.install
--- modules/upload/upload.install	4 Nov 2007 14:33:07 -0000	1.4
+++ modules/upload/upload.install	7 Nov 2007 15:09:44 -0000
@@ -23,7 +23,7 @@ function upload_uninstall() {
 function upload_schema() {
   $schema['upload'] = array(
     'description' => t('Stores uploaded file information and table associations.'),
-    'fields' => array(
+    'columns' => array(
       'fid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
Index: modules/user/user.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.install,v
retrieving revision 1.3
diff -u -F^f -r1.3 user.install
--- modules/user/user.install	4 Nov 2007 14:33:07 -0000	1.3
+++ modules/user/user.install	7 Nov 2007 15:09:44 -0000
@@ -7,7 +7,7 @@
 function user_schema() {
   $schema['access'] = array(
     'description' => t('Stores site access rules.'),
-    'fields' => array(
+    'columns' => array(
       'aid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -40,7 +40,7 @@ function user_schema() {
 
   $schema['authmap'] = array(
     'description' => t('Stores distributed authentication mapping.'),
-    'fields' => array(
+    'columns' => array(
       'aid' => array(
         'description' => t('Primary Key: Unique authmap ID.'),
         'type' => 'serial',
@@ -74,7 +74,7 @@ function user_schema() {
 
   $schema['permission'] = array(
     'description' => t('Stores permissions for users.'),
-    'fields' => array(
+    'columns' => array(
       'pid' => array(
         'type' => 'serial',
         'not null' => TRUE,
@@ -107,7 +107,7 @@ function user_schema() {
 
   $schema['role'] = array(
     'description' => t('Stores user roles.'),
-    'fields' => array(
+    'columns' => array(
       'rid' => array(
         'type' => 'serial',
         'unsigned' => TRUE,
@@ -128,7 +128,7 @@ function user_schema() {
 
   $schema['users'] = array(
     'description' => t('Stores user data.'),
-    'fields' => array(
+    'columns' => array(
       'uid' => array(
         'type' => 'serial',
         'unsigned' => TRUE,
@@ -260,7 +260,7 @@ function user_schema() {
 
   $schema['users_roles'] = array(
     'description' => t('Maps users to roles.'),
-    'fields' => array(
+    'columns' => array(
       'uid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
