RE: Request for Implementation of Custom Error Messages for CHECK Constraints - Mailing list pgsql-hackers

From Miguel Ferreira
Subject RE: Request for Implementation of Custom Error Messages for CHECK Constraints
Date
Msg-id 001301dbc260$b9762be0$2c6283a0$@gmail.com
Whole thread Raw
In response to Re: Request for Implementation of Custom Error Messages for CHECK Constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Why don't you just choose better names for your constraints?

A word versus a sentence. It's a big difference that greatly improves the
user experience.

> I'd argue that the proposed change might actually be a net loss for
usability, if it entirely obscures the fact that what happened was a
check-constraint violation.

I understand, I'm looking at it from the point of view of the end user who
is using an application. This application will not need to handle the
message if the database generates a more 'user-friendly' message.

> It's also not very clear why we'd stop with check constraints, if the
desire is to get rid of database-produced error messages in favor of
something that somebody likes better.

The idea is just to be able to define a different message. if I have to use
a trigger to set a different message, then I have to write the same rule
twice, in CHECK and TRIGGER, which is redundant.

Best regards,
Miguel Ferreira




pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Request for Implementation of Custom Error Messages for CHECK Constraints
Next
From: "Miguel Ferreira"
Date:
Subject: RE: Request for Implementation of Custom Error Messages for CHECK Constraints