Informix Error -19831: Referential constraints are not allowed on tables of type raw.
Cause and resolution
Referential constraints are not allowed on tables of type raw.
The CREATE TABLE statement contains constraints that are not allowed for RAW tables. Check your statement to make sure you do not define these kinds of constraints on RAW tables. This error could also occur if you try to alter a STANDARD table to RAW but the table has referential constraints.
You must alter the RAW table to a STANDARD table if you want to use referential constraints.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19831 fires when a referential constraint is defined on, or a table with one is altered to,
RAW — per the official guidance.
- A
CREATE TABLEstatement defining a referential constraint on aRAWtable, per the official guidance — the first named case. ALTER TABLE ... TYPE (RAW)on aSTANDARDtable that has referential constraints, per the official guidance — the second named case.
Solutions / Resolution
- Remove the referential constraint(s) from the
RAWtable definition, per the official guidance. - Alter the table to
STANDARDif referential constraints are needed, per the official guidance.
Examples
A referential constraint on a RAW table
CREATE TABLE mytab (id INT REFERENCES othertab(id)) RAW;
-- -19831
Corrected
CREATE TABLE mytab (id INT REFERENCES othertab(id));
Diagnostic Checks
- Check whether the
RAWtable (or a table being altered toRAW) has referential constraints, and remove them or useSTANDARDinstead.
Related Errors / Related Topics
- -19830 — "This operation is not allowed on a table where the type is raw." The
general
RAW-table restriction this is a specific case of, for referential constraints.
RAW tables can't have referential constraints — remove them, or use STANDARD.