Re: [PATCH] SQL assertions prototype

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: [PATCH] SQL assertions prototype
Дата
Msg-id 1387383869.66054.YahooMailNeo@web162903.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: [PATCH] SQL assertions prototype  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Josh Berkus <josh@agliodbs.com> wrote:

> Serializable or not, *what* do we lock for assertions?  It's not
> rows.  Tables?  Which tables?  What if the assertion is an
> interpreted language function?  Does the SSI reference counter
> really take care of all of this?

The simple answer is that, without adding any additional blocking,
SSI guarantees that the behavior of running any set of concurrent
serializable transactions is consistent with some serial
(one-at-a-time) execution of those transactions.  If the assertion
is run as part of the transaction, it is automatically handled,
regardless of the issues you are asking about.

The longer answer is in the README and the papers it references:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/storage/lmgr/README-SSI;hb=master

For practical examples of how it works, this Wiki page includes
examples of maintaining a multi-table invariant using triggers:

http://wiki.postgresql.org/wiki/SSI

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sawada Masahiko
Дата:
Сообщение: Re: Logging WAL when updating hintbit
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCH] SQL assertions prototype