Informix Error -328
-328 Column column-name already exists in table.
This statement tries to add the column shown, but one with that name already exists. Check the spelling of the name; if it is as you intended, then the table is not arranged as you expected it to be. You can review the names of all the columns in a table by querying syscolumns. Supply a table-name in the following query:
SELECT colname, colno FROM syscolumns C, systables T WHERE C.tabid = T.tabid AND T.tabname = 'table-name'
You can use RENAME COLUMN to change column names.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-328 is the column-level counterpart of -310: an ALTER TABLE ADD statement names a column
that already exists in the table.
- An
ALTER TABLE ADDstatement using a column name already present — the direct, most common cause. - Running a migration script more than once without a preceding existence check.
- A schema-diff/comparison tool generating an
ADD COLUMNstatement against a table that was already updated, out of sync with the tool's expected baseline. - A typo in the intended new column name that happens to collide with an existing column.
Solutions / Resolution
- Verify the column name's spelling, per the official guidance, and confirm it's genuinely meant to be new.
- Check the table's existing structure via
syscolumns:SELECT colname FROM syscolumns WHERE tabid = (SELECT tabid FROM systables WHERE tabname = 'orders'); - If the intent is actually to rename an existing column, use
RENAME COLUMNinstead of trying to add a new one:RENAME COLUMN orders.old_name TO new_name; - For repeatable migration scripts, check for the column's existence first before attempting to add it.
Examples
Re-running a migration script
ALTER TABLE orders ADD (shipping_status VARCHAR(20));
-- Running the same migration again later:
ALTER TABLE orders ADD (shipping_status VARCHAR(20));
-- -328: shipping_status already exists
Fix — check first, or make the script idempotent:
SELECT colname FROM syscolumns
WHERE tabid = (SELECT tabid FROM systables WHERE tabname = 'orders')
AND colname = 'shipping_status';
-- only ALTER TABLE ADD if not found
Using RENAME COLUMN instead of ADD
-- Intent was actually to rename, not add:
RENAME COLUMN orders.status TO shipping_status;
Diagnostic Checks
- Query
syscolumnsfor the table in question to confirm whether the column name is already taken. - Confirm whether the actual intent is to add a new column or rename an existing one.
Related Errors / Related Topics
- -310 — "Table table-name already exists in database." The table-level counterpart of this same uniqueness restriction.
- -316 — "Index index-name already exists in database." Another already-exists restriction in the same general schema-object-naming family.
Check syscolumns before assuming a name collision is a mistake — it may simply mean the
migration already ran, or that RENAME COLUMN is the operation actually needed.