Re: Partitioning/inherited tables vs FKs - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Partitioning/inherited tables vs FKs
Date
Msg-id 4BE91E450200002500031507@gw.wicourts.gov
Whole thread Raw
In response to Re: Partitioning/inherited tables vs FKs  (Nicolas Barbier <nicolas.barbier@gmail.com>)
List pgsql-hackers
Nicolas Barbier <nicolas.barbier@gmail.com> wrote:
>>>>>>> Switch to T1:
> 
> 1> COMMIT; -- Commit the insertion...
> COMMIT
> 
>>>>>>> T2 continues:
> 
> DELETE 1
> T2> COMMIT; -- Commit the deletion of a with i = 1.
> COMMIT
> T2> SELECT * FROM b EXCEPT SELECT * FROM a;
>  a_id
> ------
>     1
> (1 Zeile)
> 
> Woops.
This is exactly the sort of issue for which true serializable
behavior will provide a solution.  I will be offering a patch to
implement that for 9.1 once 9.0 settles down.  FWIW when you commit
T1, the patched code rolls back T2 with this message:
T2> DELETE FROM a WHERE i = 1;
ERROR:  could not serialize access due to read/write dependencies
among transactions
HINT:  The transaction might succeed if retried.
Thanks for the example; I will it to the others.
-Kevin


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: List traffic
Next
From: Simon Riggs
Date:
Subject: Re: List traffic