Re: [HACKERS] Weired FK problem

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jan Wieck <wieck(at)debis(dot)com>
Cc: PostgreSQL HACKERS <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Weired FK problem
Date: 1999-12-10 19:17:28
Message-ID: 199912101917.OAA29438@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-12-10 19:41:50 Re: [HACKERS] Weired FK problem
Previous Message Lamar Owen 1999-12-10 19:11:26 Re: [HACKERS] question