8.6. Transactions and Locking

In contrast to some other open source databases, PostgreSQL provides a highly developed system for handling transactions. This is one of the features that makes PostgreSQL such a good choice for almost all purposes.

In this section you will learn about PostgreSQL's transaction-handling capabilities, and you will see how transactions can be used efficiently to build even more sophisticated applications and to protect your data.

8.6.1. The Main Idea of Transactions

Imagine a simple example: Your database contains a table with 200 million records in it. One user starts a query that goes through all records and computes the average of a column. Because the table is very large, this will take some time. While the query ...

Get PHP and PostgreSQL: Advanced Web Programming 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.