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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
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 19:22:22
Message-ID: aCJKbvyQfVx_sZqu@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 12, 2025 at 11:22:21AM -0700, David G. Johnston wrote:
> 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.

Yes, that would be a limiting factor.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Do not let urgent matters crowd out time for investment in the future.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-05-12 20:58:49 Re: Proposal: Exploring LSM Tree‑Based Storage Engine for PostgreSQL (Inspired by MyRocks)
Previous Message Matthias van de Meent 2025-05-12 19:20:25 Re: Proposal: Exploring LSM Tree‑Based Storage Engine for PostgreSQL (Inspired by MyRocks)