Re: How to get column, table or parameter name reporting when violating DOMAIN type constraint - Mailing list pgsql-novice

From David G. Johnston
Subject Re: How to get column, table or parameter name reporting when violating DOMAIN type constraint
Date
Msg-id CAKFQuwa00CR2HPxmngsGqx0mGOc4j215gZ4j_v32OYO_gfpQYg@mail.gmail.com
Whole thread Raw
In response to Re: How to get column, table or parameter name reporting when violating DOMAIN type constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How to get column, table or parameter name reporting when violating DOMAIN type constraint
List pgsql-novice
On Sunday, March 26, 2023, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Sunday, March 26, 2023, Valerio Battaglia <vabatta@gmail.com> wrote:
>> Is there a way to obtain more detailed information about the column, table
>> or parameter that is causing the constraint violation in this scenario? I
>> would greatly appreciate any guidance or advice you could provide on this
>> matter

> What you see is what you get.

More to the point, you have the wrong mental model: a domain constraint
violation might not be associated with a table column at all.


I disagree that the mental model is wrong.  Asking for better context when constructing rows is a common request not only for domains but even simple data types like dates or numbers.  Sure, that added context is not always applicable but when it is the lack of error detail does make life hard.  But it isn’t an easy problem to solve either.

There are existing threads that I may hunt later.  IIRC, you (Tom) even suggested a possible way forward on this last time it came up.

David J.

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to get column, table or parameter name reporting when violating DOMAIN type constraint
Next
From: Tom Lane
Date:
Subject: Re: How to get column, table or parameter name reporting when violating DOMAIN type constraint