Re: Proposal: Include CHECK constraint expression in violation error DETAIL

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
Cc: Yash Jadhav <yash(dot)jadhav8008(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal: Include CHECK constraint expression in violation error DETAIL
Date: 2026-11-29 01:10:47
Message-ID: CACJufxFvQQzeDrsJ9vPEYz-15POotHw21HMr+bR95drkhao69g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 26, 2026 at 5:36 PM Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp> wrote:
>
> I have removed the redundant check_desc checks from both places and
> attached the updated patch.
>
Hi.

ERROR: new row for relation "staff_sales" violates check constraint
"staff_age_check"
DETAIL: Failing row contains (1, 15). Check constraint expression: (age >= 18).

DETAIL mention 2 different, seemingly unrelated things, which seems uncommon.
Just wondering, have you considered adding it to errhint.

ERROR: new row for relation "staff_sales" violates check constraint
"staff_age_check"
DETAIL: Failing row contains (1, 15).
HINT: The row must satisfy the check constraint expression (age >= 18).

--
jian
https://www.enterprisedb.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-11-29 01:53:01 Re: RFC: Logging plan of the running query
Previous Message Sho Ito 2026-11-29 00:38:31 Re: [PATCH] Improve tab completion after CREATE INDEX key list