Thread: Bug report

Bug report

From
Frank Cusack
Date:
FAQ 1.13 says to fill out the "bug-template" file but I cannot find this
file in the distribution.

This is for:
[PostgreSQL 6.5.1 on sparc-sun-solaris2.6, compiled by gcc egcs-2.91.66]

The bug is that when naming a constraint such as:

...
CONSTRAINT ip_must_be_unique UNIQUE(ip),
...

and attempting to insert a non-unique value, the error is just
"ERROR:  Cannot insert a duplicate key into a unique index"
[This is using the perl5 interface.]

But if you do a CHECK constraint like:

...
CONSTRAINT ns_type CHECK (ns_type >= 0 AND ns_type <= 4),
...

the error uses the constraint name in the error message.

I feel the first case should also include the constraint name in the
message, this would be much more useful for error reporting. Perhaps
just add the text "due to CONSTRAINT xxx" to the first case error,
when a named constraint is given.

~f