Re: Constraint violations don't report the value that violates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
Cc: PostgreSQL - General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: Constraint violations don't report the value that violates
Date: 2008-02-07 00:01:14
Message-ID: 20248.1202342474@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Russell Smith <mr-russ(at)pws(dot)com(dot)au> writes:
> I've would find it useful if check constraints and unique constraints
> would give a value which is violating the constraint.

> Foreign keys give a value that is failing for the foreign key, is there
> a reason that other constraints don't do the same thing?

It's not very well-defined, for instance what would you report for

CHECK some_black_box_function(a, b, c+d)

FKs are constrained by the spec syntax to only involve simple column
values, but this is not the case for either CHECK or unique indexes.

Unique partial indexes would make things even more interesting.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-02-07 01:21:11 Re: DBA Book - Not "postgresql book - practical or something newer?"
Previous Message Tom Lane 2008-02-06 23:25:06 Re: Fossology Install & Config Issues...