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

From Dickson S. Guedes
Subject Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Date
Msg-id CAHHcreq_s7TunxZw4N=62XrYNSHgwE_Agi6qFqETcXR0+CTpTQ@mail.gmail.com
Whole thread Raw
In response to Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message  (Jan Kundrát <jkt@flaska.net>)
Responses Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
List pgsql-hackers
2011/11/10 Jan Kundrát <jkt@flaska.net>:
> On 11/10/11 03:47, Robert Haas wrote:
>> It does this already, without this patch.  This patch is about CHECK
>> constraints, not UNIQUE ones.
>
> That's right. This is how to check what the patch changes:
>
> jkt=> CREATE TABLE tbl (name TEXT PRIMARY KEY, a INTEGER CHECK (a>0));
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "tbl_pkey" for table "tbl"
> CREATE TABLE
> jkt=> INSERT INTO tbl (name, a) VALUES ('x', 10);
> INSERT 0 1
> 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.

--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br


pgsql-hackers by date:

Previous
From: Jan Kundrát
Date:
Subject: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Next
From: Jan Kundrát
Date:
Subject: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message