From: | "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net> |
---|---|
To: | Jan Kundrát <jkt(at)flaska(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, jose(dot)arthur(at)gmail(dot)com |
Subject: | Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message |
Date: | 2011-11-10 11:41:00 |
Message-ID: | CAHHcreq_s7TunxZw4N=62XrYNSHgwE_Agi6qFqETcXR0+CTpTQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2011/11/10 Jan Kundrát <jkt(at)flaska(dot)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(at)guedesoft(dot)net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Kundrát | 2011-11-10 11:46:36 | Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message |
Previous Message | Jan Kundrát | 2011-11-10 10:40:58 | Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message |