Re: Request for Implementation of Custom Error Messages for CHECK Constraints

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Miguel Ferreira <miguelmbferreira(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Request for Implementation of Custom Error Messages for CHECK Constraints
Date: 2025-05-12 18:22:21
Message-ID: CAKFQuwbezTS9OESdzY6S2Vzj27MTj9KT=ZSk-FDv3gx1iUzVUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, May 12, 2025, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
>
> Yeah, you could name the constraint
> "Custom_error_message_when_the_condition_is_not_met." and then just
> convert underscore to spaces and display that to the user.
>
>
The 63 byte limit seems much more likely to be a factor if the name has to
serve the duty of a human-friendly error message.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2025-05-12 18:33:14 Re: INSERT ... ON CONFLICT DO SELECT [FOR ...] take 2
Previous Message Bruce Momjian 2025-05-12 18:19:35 Re: Request for Implementation of Custom Error Messages for CHECK Constraints