Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering PostgreSQL 10

You're reading from  Mastering PostgreSQL 10

Product type Book
Published in Jan 2018
Publisher Packt
ISBN-13 9781788472296
Pages 428 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

Preface 1. PostgreSQL Overview 2. Understanding Transactions and Locking 3. Making Use of Indexes 4. Handling Advanced SQL 5. Log Files and System Statistics 6. Optimizing Queries for Good Performance 7. Writing Stored Procedures 8. Managing PostgreSQL Security 9. Handling Backup and Recovery 10. Making Sense of Backups and Replication 11. Deciding on Useful Extensions 12. Troubleshooting PostgreSQL 13. Migrating to PostgreSQL 14. Other Books You May Enjoy

Understanding the transaction log

Every modern database system provides functionality to make sure that the system can survive a crash in case something goes wrong or somebody pulls the plug. This is true for filesystems and database systems alike.

PostgreSQL also provides a means to ensure that a crash cannot harm the data's integrity or the data itself. It is guaranteed that if the power cuts out, the system will always be able to come back up again and do its job.

The means to provide this kind of security is provided by the Write Ahead Log (WAL) or xlog. The idea is to not write into the data file directly, but instead write to the log first. Why is that important? Imagine you are writing some data:

INSERT INTO data ... VALUES ('12345678');

Suppose data was written directly to the data file. If the operation fails somewhere in the middle, the data file would...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}