On Tue, Sep 15, 2009 at 11:21:14PM +1000, Brendan Jurd wrote:
> 2009/9/15 Jeff Davis <pgsql@j-davis.com>:
> > Attached is the latest version.
> >
>
> The new error message for a conflict is:
>
> ERROR: index constraint violation detected
> DETAIL: tuple conflicts with existing data
>
> How about also including the name of the constraint (or index) that
> was violated? I could imagine this error message being frustrating
> for someone who had a table with multiple index constraints, as they
> wouldn't know which one had raised the conflict.
Perhaps the tuple that caused the violation as well, like UNIQUE index
violations already do? Even if we know what constraint has been tripped, we
might not know what value did it.
josh@josh# create table a (a integer);
josh@josh*# create unique index a_unique on a (a);
josh@josh*# insert into a values (1), (2), (3);
josh@josh*# insert into a values (8), (3), (4);
ERROR: duplicate key value violates unique constraint "a_unique"
DETAIL: Key (a)=(3) already exists.
--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com