Re: assertions and constraint triggers

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: assertions and constraint triggers
Date: 2010-08-11 15:47:44
Message-ID: 1281541664.26522.6.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On ons, 2010-08-11 at 13:23 +0300, Marko Tiikkaja wrote:
> But you'd have to somehow make the constraints to be checked
> with true serializability, and that part of the original suggestion
> seemed to be completely missing. Not sure how hard that would be
> though.

I don't think somehow running the constraint checks at a different
transaction isolation level than the rest of the transaction is
sensible. I imagine the solution would look similar to how foreign keys
do it: take a lock on the rows that are required for constraint
satisfaction. For general assertions, this would require predicate
locking. But also notice that for the (SELECT count(*) FROM tbl) = N
case, this is the same as a table lock. I don't think there is any
magic around it.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-11 15:48:26 Re: Inconsistent ::bit(N) and get_bit()?
Previous Message Tom Lane 2010-08-11 15:47:23 Re: Regression tests versus the buildfarm environment