EllisLab/CodeIgniter — Issue #857: dbforge add_column bug for postgres
Author: frankwong
Created: 2012-01-03 04:28:41+00:00
State: open

Found this error while trying to implement migration on a postgres database.

Issue: When trying to alter a table by adding a column, I would call the dbforge->add_column method and it then calls the _alter_table method in the database/drivers/postgre/postgre_forge.php file.

The call from dbforge->add_column

```php
$sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field);
```

The method definition

```php
function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
```

Problem: The definition is incorrectly overloaded. The logic might be incorrect also, but have not been verified.