public inbox for [email protected]
help / color / mirror / Atom feedFrom: Matheus Alcantara <[email protected]>
To: Peter Eisentraut <[email protected]>
To: Matheus Alcantara <[email protected]>
To: [email protected]
Subject: Re: Show expression of virtual columns in error messages
Date: Wed, 04 Feb 2026 14:54:11 -0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On Wed Feb 4, 2026 at 11:57 AM -03, Peter Eisentraut wrote:
> On 03.02.26 15:06, Matheus Alcantara wrote:
>> The attached patch changes this behavior to show the virtual column
>> expression instead:
>>
>> ERROR: new row for relation "t" violates check constraint "t_c_check"
>> DETAIL: Failing row contains (5, 10, a * 2).
>
> Could be useful, but in this context you don't know which column is "a"?
I agree but we at least show more information to the user. The user may
still need to check the table definition to understand the constraint or
to get the column ordering of the table to understand what the value of
"a" is being used to compute the expression.
If the statement declare the columns that the values are referecing this
could be easier to know (e.g INSERT INTO t(a, b) VALUES (5, 10)) but the
user may still need to check the table definition to understand the
constraint.
I see this patch as a way to at least give more information to user
about the error.
Another possibility would be to get the actual values of "a" for example
and show it on the error message, e.g:
ERROR: new row for relation "t" violates check constraint "t_c_check"
DETAIL: Failing row contains (5, 10, 5 * 2).
--
Matheus Alcantara
EDB: https://www.enterprisedb.com
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Show expression of virtual columns in error messages
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox