Re: [PATCH] SQL assertions prototype - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: [PATCH] SQL assertions prototype
Date
Msg-id 1387409996.72263.YahooMailNeo@web162905.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: [PATCH] SQL assertions prototype  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Josh Berkus <josh@agliodbs.com> wrote:
> On 12/18/2013 11:26 AM, Jim Nasby wrote:

>> Another possibility is to allow for two different types of
>> assertions, one based on SSI and one based on locking.
>
> The locking version would have to pretty much lock on a table
> basis (or even a whole-database basis) every time an assertion
> executed, no?

As far as I can see, if SSI is *not* used, there needs to be a
mutually exclusive lock taken from somewhere inside the COMMIT code
until the transaction is complete -- effectively serializing
assertion processing for transactions which could affect a given
assertion.  Locking on tables would, as previously suggested, be
very prone to deadlocks on the heavyweight locks.  Locking on the
assertions in a predictable order seems more promising, especially
if there could be some way to only do that if the transaction
really might have done something which could affect the truth of
the assertion.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: array_length(anyarray)
Next
From: Bruce Momjian
Date:
Subject: Re: New option for pg_basebackup, to specify a different directory for pg_xlog