Re: Problem with a constraint check on a table.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Fabre Lambeau" <faml2(at)cam(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org, "Christian LAMBEAU" <lambeau_christian(at)hotmail(dot)com>
Subject: Re: Problem with a constraint check on a table.
Date: 2003-07-20 05:04:25
Message-ID: 20084.1058677465@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Fabre Lambeau" <faml2(at)cam(dot)ac(dot)uk> writes:
> I then tried to add a new record, duplicating another one with both
> contact_validity and contact_principal being 'true' (I changed the
> contact_id, obviously, to avoid duplicate entries in primary key).
> PostgreSQL let me insert it, without raising an error, although the function
> is_principalcontact_unique(actor_id, contacttype_id) now returns 'false'
> Any idea why it is so?

Because the constraint is checked before the row is actually inserted.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-07-20 05:08:08 Re: Is there a way to pass more than 32 parameters to a
Previous Message Tom Lane 2003-07-20 04:59:47 Re: Error Message Using pg_dumpall