SQLSTATE 23514Severity lowLab verified

Incident brief

New row violates check constraint

A column or table has a CHECK constraint, and an INSERT or UPDATE produced a row where that check evaluated to false. PostgreSQL rejects the row.

Reproduced on PostgreSQL 16.14Verified 2026-07-15 (Docker lab, PostgreSQL 16.14)Reviewed by Verified against PostgreSQL 16.14 in an isolated lab environment

In 10 seconds

What
New row violates check constraint
What triggers it
Create a table with a CHECK constraint, for example price > 0.
The fix
Fix the value so it satisfies the check before inserting.
Proof
Reproduced on PostgreSQL 16.14 → The INSERT with price = -10 was rejected with SQLSTATE 23514 because -10 > 0 is false, and the row was never stored.

The fix

What to do right now

The immediate, application-level response to this error.

  • Fix the value so it satisfies the check before inserting.
  • If the rule was wrong, ALTER the constraint rather than working around it in application code.
  • Remember a CHECK constraint passes on NULL — pair it with NOT NULL if NULL should also be rejected.
Fix — SQL
CREATE TABLE catalog.products (
  id integer primary key,
  price numeric CHECK (price > 0)
);

-- a value that satisfies the check
INSERT INTO catalog.products (id, price) VALUES (1, 19.99);

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 16.14
Last verified
2026-07-15 (Docker lab, PostgreSQL 16.14)
Reviewed by
Verified against PostgreSQL 16.14 in an isolated lab environment
Audit status
reviewed