Serialization

Now, if the idea that UPDATE and DELETE statements made by other sessions will leak into your view of the database state even within a transaction horrifies you, what you probably want is the other transaction isolation method: serializable.

There are actually two slightly different MVCC modes available in PostgreSQL to help address different requirements here. These reflect two behaviors from the SQL standard, introduced at http://www.postgresql.org/docs/current/static/transaction-iso.html. The problems described there, such as non-repeatable and phantom reads, require using the database's more complicated serializable mode to avoid them, instead of the simpler and default Read Committed transaction model. It's worth reading ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.