Josh Berkus <j...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers