Re: Guarenteeing complex referencial integrity through custom triggers - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: Guarenteeing complex referencial integrity through custom triggers
Date
Msg-id ab4d01c76ec559d70092624b5c4c5871@biglumber.com
Whole thread Raw
In response to Guarenteeing complex referencial integrity through custom triggers  ("Joris Dobbelsteen" <Joris@familiedobbelsteen.nl>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> Included is a more eloborate example, which has some webby thing at
> http://www.familiedobbelsteen.nl/printer-test/ (should work).

Much too elaborate - I'm sorry, but I don't think anyone here is willing 
to wade through nearly 900 lines of code. Can you break it down to a 
simpler test case? Or try and break the schema I provided in my 
previous message perhaps?

> You cannot enforce the above constraint in the database. The keyword is
> serializable isolation level.
>
> Create new printer + cartidge_defs and such.
> Now in T1 delete a cartridge_def
> Now in T2 insert a cartridge replacement.

Works as expected in my schema when I tried it: T2 blocked at the insert, 
waiting on T1. Once T1 committed, T2 threw an error, as the insert was no 
longer valid. Using serializable or not, same result.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200703272044
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGCbqSvJuQZxSWSsgRA6SXAJ0Wehl9d5PGEsnyRk+FP8fNy21GzwCg06l4
DVog8s9FEXKQ5R6U2DDe/Pw=
=n4Vl
-----END PGP SIGNATURE-----




pgsql-hackers by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: Proposal: Adding JIS X 0213 support
Next
From: Tom Lane
Date:
Subject: Re: Reduction in WAL for UPDATEs