Skip to content
  • Getting Started
  • HELP
  • Error Messages
  • INTEGRITY_CONSTRAINT_VIOLATION

Error code: INTEGRITY_CONSTRAINT_VIOLATION

This guide presents integrity constraint (IC) violations and ways to solve them.

An integrity constraint ensures the integrity of the database, requiring that its relations and data obey the specified constraint.

Consider the following example where you define the relation R and add an IC to it:

def R = { 0 }
ic (x in R) { x > 0 }
Error example from the RAI Console

The IC enforces that every element in the relation R must be greater than 0. Therefore, your definition of R is not valid, since 0 is not greater than 0, and the example above returns an IC violation.

When an IC is violated, the running transaction is aborted and related information is returned. In this sense, an IC violation is not like other RAI errors, which show transactions as completed, but a tool you can use to guarantee certain imposed rules.

See the IC concept guide and IC Reference to learn more about ICs.

Was this doc helpful?