# Supabase: “new row for relation violates check constraint” (23514)

> Supabase error 23514 means a value broke a check constraint on the table. Read the constraint, send an allowed value, or change the rule in a migration.

Canonical: https://app369.com/fix/supabase-violates-check-constraint/
Last updated: 2026-11-09

“violates check constraint” is Postgres error 23514. A value in the row failed a rule on the table, such as a status that must be one of a few words or a price above zero. The error names the constraint, so read its definition first.

**Short answer**

The error details show the failing row, and supabase-js returns code 23514. Run the query below with the constraint name from the error to see the rule. Then send a value that passes it, watching for case and spaces, or change the rule in a migration if the app now needs new values. Adding a new check fails when old rows break it, so fix those rows first.

Rather not fix it yourself? [**App Fix Ticket**](https://app369.com/fixed-price/flutter-firebase-bug-fix/) starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.

## **Why the value is refused, and the fix**

1. 01 ### **The value isn’t one the rule allows**
  > “It allows you to specify that the value in a certain column must satisfy a Boolean (truth-value) expression.” [**PostgreSQL docs, Constraints (check)**](https://www.postgresql.org/docs/current/ddl-constraints.html) A check rule is a true or false test on the row. Look it up by the name in the error, and the definition shows exactly which values pass.```
select conrelid::regclass as table_name, conname, pg_get_constraintdef(oid)
from pg_constraint
where conname = 'orders_status_check';
```
2. 02 ### **Case or spaces don’t match** A rule like status in ('open', 'closed') refuses Open and 'open '. Send the exact value, for example from a fixed list in the app rather than free text.
3. 03 ### **The app needs a new allowed value** Change the rule in a migration. Drop the old constraint and add the new one in the same statement.```
alter table public.orders
  drop constraint orders_status_check,
  add constraint orders_status_check
    check (status in ('open', 'paid', 'refunded', 'closed'));
```
4. 04 ### **Adding the check fails on old rows**
  > “Normally, this form will cause a scan of the table to verify that all existing rows in the table satisfy the new constraint.” [**PostgreSQL docs, ALTER TABLE**](https://www.postgresql.org/docs/current/sql-altertable.html) Postgres checks every existing row when you add the constraint. Fix the rows that break it, or add it as NOT VALID, clean up, then run VALIDATE CONSTRAINT.
5. 05 ### **A check doesn’t stop empty values**
  > “It should be noted that a check constraint is satisfied if the check expression evaluates to true or the null value.” [**PostgreSQL docs, Constraints (check)**](https://www.postgresql.org/docs/current/ddl-constraints.html) A null passes most checks. If the column must have a value, add NOT NULL as well.

Checked against the vendor’s docs on November 9, 2026: [PostgreSQL docs: Constraints (check)](https://www.postgresql.org/docs/current/ddl-constraints.html); [PostgreSQL docs: ALTER TABLE](https://www.postgresql.org/docs/current/sql-altertable.html).

## **Rather hand it over?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [from $450**App Fix Ticket**One reproducible bug in an existing mobile or web app, diagnosed and fixed.**See scope and start**](https://app369.com/fixed-price/flutter-firebase-bug-fix/)
- [from $450**AI-Built App Rescue**A Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.****No issues worth fixing, no charge.**** If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.**See scope and start**](https://app369.com/fixed-price/ai-app-rescue/)

[**All 127 Fiverr reviews**](https://app369.com/reviews/)

Related: [**Supabase value too long for character varying**](https://app369.com/fix/supabase-value-too-long-for-type-character-varying/) · [**Supabase violates not-null constraint**](https://app369.com/fix/supabase-null-value-violates-not-null-constraint/) · [**Supabase violates foreign key constraint**](https://app369.com/fix/supabase-violates-foreign-key-constraint/) · [**Supabase duplicate key violates unique constraint**](https://app369.com/fix/supabase-duplicate-key-violates-unique-constraint/)

Questions

## **More on this error**

<details>

<summary>**Where did the constraint come from? **+</summary>

Someone added it, often a migration, a table editor setting, or a generated schema. Its name usually follows table_column_check, which points to the column.

</details>

<details>

<summary>**Should I use an enum instead? **+</summary>

An enum type works for a fixed list too, and adding a value to it is easy. Removing a value is easier with a check, because you drop and add it in one migration.

</details>

<details>

<summary>**Can you fix it for me? **+</summary>

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

</details>

A different error?

## **Describe it and get a written quote**

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.

[**Describe your problem **→](https://app369.com/contact/) [**All fixes**](https://app369.com/fix/)