Re: WIP: generalized index constraints

Поиск
Список
Период
Сортировка
От Joshua Tolley
Тема Re: WIP: generalized index constraints
Дата
Msg-id 20090915140838.GS4687@eddie
обсуждение исходный текст
Ответ на Re: WIP: generalized index constraints  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: WIP: generalized index constraints  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: CommitFest 2009-09: Now In Progress
Следующее
От: Robert Haas
Дата:
Сообщение: Re: CommitFest 2009-09: Now In Progress