Re: Guarenteeing complex referencial integrity through custom triggers

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Guarenteeing complex referencial integrity through custom triggers
Date: 2007-03-28 00:49:42
Message-ID: ab4d01c76ec559d70092624b5c4c5871@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)com
PGP Key: 0x14964AC8 200703272044
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-28 00:54:17 Re: Concurrent connections in psql
Previous Message Tom Lane 2007-03-28 00:48:43 Re: Reduction in WAL for UPDATEs