Informix Error -326
-326 Referential constraint has too many referenced columns.
The specified referential constraint has more than 16 columns (or 8 in IBM Informix SE).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-326 is an implementation limit on composite foreign keys: a referential constraint can list at most 16 columns on standard Informix, or 8 columns on IBM Informix SE — a much narrower ceiling on the older SE engine.
- A composite foreign key referencing more columns than the server's limit — the direct cause, most likely to surface on wide, highly composite keys.
- Running the same schema against both standard Informix and Informix SE, where a constraint valid on one (up to 16 columns) exceeds the other's stricter 8-column limit.
- A key design that grew over time — columns added to a composite key incrementally without revisiting whether the total was approaching either limit.
Solutions / Resolution
- Reduce the number of columns in the referential constraint to within the applicable limit (16 for standard Informix, 8 for Informix SE), per the official guidance.
- Consider introducing a surrogate key (a single-column synthetic identifier) instead of a wide composite key, if the natural key genuinely needs more columns than the limit allows.
- If targeting Informix SE specifically, design composite keys with the stricter 8-column limit in mind from the start, even if the primary target is standard Informix.
Examples
A composite key exceeding the limit
-- Assume this composite key spans 17 columns on standard Informix
ALTER TABLE order_line_items ADD CONSTRAINT
FOREIGN KEY (col1, col2, col3, /* ... 17 columns total ... */)
REFERENCES order_headers(col1, col2, col3, /* ... */);
-- -326: exceeds the 16-column limit
Fix — introduce a surrogate key to replace the wide composite:
ALTER TABLE order_headers ADD (order_header_id SERIAL);
ALTER TABLE order_headers ADD CONSTRAINT PRIMARY KEY (order_header_id);
ALTER TABLE order_line_items ADD (order_header_id INTEGER);
ALTER TABLE order_line_items ADD CONSTRAINT
FOREIGN KEY (order_header_id) REFERENCES order_headers(order_header_id);
Diagnostic Checks
- Count the columns in the referential constraint's column list and compare against the applicable limit for the target server edition.
- Confirm which Informix edition (standard vs. SE) the schema is being deployed against, since the limit differs significantly between them.
Related Errors / Related Topics
- -295 — "Referenced and referencing tables have to be in the same database." Another referential-constraint restriction in the same general foreign-key-setup family.
- -297 — "Cannot find unique constraint or primary key on referenced table table-name." Another constraint-setup error in the same family.
A surrogate single-column key is usually a cleaner fix than trimming a genuinely wide natural composite key down to fit the column limit.