Re: [HACKERS] Weired FK problem - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Weired FK problem
Date
Msg-id 199912101917.OAA29438@candle.pha.pa.us
Whole thread Raw
In response to Weired FK problem  (wieck@debis.com (Jan Wieck))
Responses Re: [HACKERS] Weired FK problem
List pgsql-hackers
Looks like it works.  I just tried a related item:

>     Now the other way round:
> 
>     (S1)    insert into t1 values (1);
>     (S1)    begin;

>     (S2)    delete from t1 where a = 1;
>     (S1)    insert into t2 values (1);

I swapped the above two items, and the INSERT properly failed the
contraint.

> 
>     (S2)    -- Session is now blocked
> 
>     (S1)    commit;
> 
>     (S2)    -- Session continues without error

I was a little unsure how trigger visibility was going to handle cases
where the constraint failure happened after the other transaction
started, but it seems to work fine.

It is only the trigger that has full visibility, not the statements in
the query, right?

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: [HACKERS] question
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Weired FK problem