Book Image

Troubleshooting PostgreSQL

Book Image

Troubleshooting PostgreSQL

Overview of this book

If you are a database administrator looking for solutions to common PostgreSQL problems, this is the book for you. The book is suitable for people with intermediate and professional expertise.
Table of Contents (12 chapters)
11
Index

Chapter 5. Getting Transactions and Locking Right

Transactions are a core technique of every professional relational database system. In fact, it is pretty hard to imagine a world without transactions these days. Atomic deletions, proper locking, and all the functionalities provided by a modern relational system are simple and expected from a modern system, and many applications rely on them. Therefore, this chapter is all about transactions and locking.

The following topics will be covered:

  • The PostgreSQL transaction model
  • Basic locking
  • FOR UPDATE, FOR SHARE, and NOWAIT
  • Locking tables
  • Understanding transaction isolation levels
  • Indexes and foreign keys
  • Transactions and sequences