Skip site navigation (1) Skip section navigation (2)

Re: DEFERABLE vs. NOT DEFERABLE constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Claude Chaloux <claude(dot)chaloux(at)abovesecurity(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: DEFERABLE vs. NOT DEFERABLE constraints
Date: 2007-07-24 19:47:00
Message-ID: 15200.1185306420@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> writes:
> On Tue, 24 Jul 2007, Claude Chaloux wrote:
>> Basically, the function inserts a row in a table (in the database I'm
>> testing with) that has a reference (foreign key set) to another table.
>> Under 7.4, I have no problem inserting the rows in the two tables even
>> when inserting in the table which column is being referenced first. On
>> 8.2 however, I get an error message "constraint violation".

> In 7.4, a not deferred trigger caused by a statement in a function was
> still delayed until the end of the statement that called the function. As
> of 8.0, a not deferred trigger is called at the end of the statement in
> the function.

Note that if the constraint is marked DEFERRABLE INITIALLY DEFERRED,
it should be checked at transaction end in either version.  Are you
sure you really have it set to deferred?

			regards, tom lane

In response to

pgsql-novice by date

Next:From: JillDate: 2007-07-24 19:59:14
Subject: check (constraint) on point data type?
Previous:From: Stephan SzaboDate: 2007-07-24 19:12:46
Subject: Re: DEFERABLE vs. NOT DEFERABLE constraints

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group