Informix Error -26911: The statement failed because each constraint on a rolling window table requires a supporting index.
Cause and resolution
The statement failed because each constraint on a rolling window table requires a supporting index.
You cannot add a PRIMARY KEY, FOREIGN KEY or UNIQUE constraint on a rolling window table unless an index on the table has the same RANGE INTERVAL fragmentation strategy as the table.
Explicitly create an index on the table (with no storage option for the index) before you add the PRIMARY KEY, FOREIGN KEY, or UNIQUE constraint.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-26911 fires when a PRIMARY KEY/FOREIGN KEY/UNIQUE constraint is added to a
rolling window table without a matching supporting index — per the official guidance.
- No index on the table shares the same
RANGE INTERVALfragmentation strategy as the table itself, per the official guidance — the direct, only cause.
Solutions / Resolution
- Explicitly create an index on the table (with no storage option) before adding the
PRIMARY KEY/FOREIGN KEY/UNIQUEconstraint, per the official guidance.
Examples
Creating the supporting index first
CREATE INDEX idx1 ON rolling_tab (id);
ALTER TABLE rolling_tab ADD CONSTRAINT PRIMARY KEY (id);
Diagnostic Checks
- Check whether an index with the same
RANGE INTERVALfragmentation strategy exists, and create one before adding the constraint.
Related Errors / Related Topics
- -26910 — "The statement failed because it referenced a rolling window table." A related rolling-window-table restriction, on being referenced as a foreign key target rather than requiring a supporting index for its own constraints.
- -26912 — "The statement failed because rowids are not allowed with rolling window
tables." A related rolling-window-table restriction, on
ROWIDcolumns rather than constraint support.
A constraint was added to a rolling window table with no matching supporting index — create the index first.