Re: Problem with a constraint check on a table. - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with a constraint check on a table.
Date
Msg-id 20084.1058677465@sss.pgh.pa.us
Whole thread Raw
In response to Problem with a constraint check on a table.  ("Fabre Lambeau" <faml2@cam.ac.uk>)
List pgsql-general
"Fabre Lambeau" <faml2@cam.ac.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

pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: Is there a way to pass more than 32 parameters to a
Next
From: Tom Lane
Date:
Subject: Re: [ADMIN] Error Message Using pg_dumpall