Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message - Mailing list pgsql-hackers

From Jan Kundrát
Subject Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Date
Msg-id 4EBBB99C.70306@flaska.net
Whole thread Raw
In response to Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message  ("Dickson S. Guedes" <listas@guedesoft.net>)
List pgsql-hackers
On 11/10/11 12:41, Dickson S. Guedes wrote:
>> jkt=> UPDATE tbl SET a = -a;
>> ERROR:  new row for relation "tbl" violates check constraint "tbl_a_check"
>> DETAIL:  New row with data (x, -10) violates check constraint "tbl_a_check".
>>
>> The last line, the detailed error message, is added by the patch.
>
> The patch uses 'New row with data ....' but it was an UPDATE, if you
> go further with this patch, IMO the message should be fixed too.

I'm not sure whether the code can determine whether the check gets
triggered by an UPDATE or an INSERT (both commands lead to this code
path). Please note that the already-existing error message (the "ERROR:
" line in the output I enclosed) already uses the phrase "new row".

That said, I'll of course be more than happy to include whatever string
which fits better, and am open to any suggestions.

Cheers,
Jan

--
Trojita, a fast e-mail client -- http://trojita.flaska.net/


pgsql-hackers by date:

Previous
From: "Dickson S. Guedes"
Date:
Subject: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Next
From: Nikhil Sontakke
Date:
Subject: Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers