function _db_process_field

6.x database.pgsql.inc _db_process_field($field)
6.x database.mysql-common.inc _db_process_field($field)

Set database-engine specific properties for a field.

Parameters

$field: A field description array, as specified in the schema documentation.

Related topics

5 calls to _db_process_field()
db_add_field in drupal-6.x/includes/database.pgsql.inc
Add a new field to a table.
db_add_field in drupal-6.x/includes/database.mysql-common.inc
Add a new field to a table.
db_change_field in drupal-6.x/includes/database.mysql-common.inc
db_create_table_sql in drupal-6.x/includes/database.pgsql.inc
Generate SQL to create a new table from a Drupal schema definition.
db_create_table_sql in drupal-6.x/includes/database.mysql-common.inc
Generate SQL to create a new table from a Drupal schema definition.

File

drupal-6.x/includes/database.pgsql.inc, line 563
Database interface code for PostgreSQL database servers.

Code

function _db_process_field($field) {
  if (!isset($field['size'])) {
    $field['size'] = 'normal';
  }
  // Set the correct database-engine specific datatype.
  if (!isset($field['pgsql_type'])) {
    $map = db_type_map();
    $field['pgsql_type'] = $map[$field['type'] . ':' . $field['size']];
  }
  if ($field['type'] == 'serial') {
    unset($field['not null']);
  }
  return $field;
}