Re: WIP: generalized index constraints - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: WIP: generalized index constraints
Date
Msg-id 37ed240d0909150621k7cb23bd3x4c278124636a00f4@mail.gmail.com
Whole thread Raw
In response to Re: WIP: generalized index constraints  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: WIP: generalized index constraints
Re: WIP: generalized index constraints
List pgsql-hackers
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.

Also, the DETAIL part should be written as a full sentence with
leading capital and full stop [1], see

I deliberately tried to create an index constraint using a bogus
operator, to see what would happen:

postgres=# alter table circles add constraint circles_overlap (c <->)
using index circle_idx;
ERROR:  no strategy found for operator 1520 in operator family 2595

The error message is pretty unfriendly, but I'm ambivalent about
whether it's worth doing anything about this particular case.

One of the comments I made in my original review [2] was that "\d" in
psql should show the constraint.  I don't think you've addressed this
in the current version.

Cheers,
BJ

[1] http://www.postgresql.org/docs/current/static/error-style-guide.html
[2] http://archives.postgresql.org/message-id/37ed240d0907152222w7ccfc13i8ce8d11a0c517e8@mail.gmail.com


pgsql-hackers by date:

Previous
From: Brendan Jurd
Date:
Subject: Re: WIP: generalized index constraints
Next
From: Peter Eisentraut
Date:
Subject: Re: Linux LSB init script