Book Image

Learn PostgreSQL - Second Edition

By : Luca Ferrari, Enrico Pirozzi
1 (2)
Book Image

Learn PostgreSQL - Second Edition

1 (2)
By: Luca Ferrari, Enrico Pirozzi

Overview of this book

The latest edition of this PostgreSQL book will help you to start using PostgreSQL from absolute scratch, helping you to quickly understand the internal workings of the database. With a structured approach and practical examples, go on a journey that covers the basics, from SQL statements and how to run server-side programs, to configuring, managing, securing, and optimizing database performance. This new edition will not only help you get to grips with all the recent changes within the PostgreSQL ecosystem but will also dig deeper into concepts like partitioning and replication with a fresh set of examples. The book is also equipped with Docker images for each chapter which makes the learning experience faster and easier. Starting with the absolute basics of databases, the book sails through to advanced concepts like window functions, logging, auditing, extending the database, configuration, partitioning, and replication. It will also help you seamlessly migrate your existing database system to PostgreSQL and contains a dedicated chapter on disaster recovery. Each chapter ends with practice questions to test your learning at regular intervals. By the end of this book, you will be able to install, configure, manage, and develop applications against a PostgreSQL database.
Table of Contents (22 chapters)
20
Other Books You May Enjoy
21
Index

Preface

PostgreSQL is one of the fastest-growing open-source object-relational Database Management Systems (DBMSs) in the world. PostgreSQL provides enterprise-level features; it’s scalable, secure, and highly efficient; it’s easy to use; and it has a very rich ecosystem that includes application drivers and tools. In this book, you will explore PostgreSQL 16, the latest stable release, and learn to build secure, reliable, and scalable database solutions using it. Complete with hands-on tutorials and a set of Docker images to follow every step-by-step example, this book will teach you how to achieve the right database design for a reliable environment.

You will learn how to install, configure, and manage a PostgreSQL server; manage users and connections; and inspect server activity for performance optimization. With question-and-answer sections for each chapter, you will be able to check your newly acquired knowledge as you go.

The book starts by introducing the main concepts surrounding PostgreSQL and how to install and connect to the database, and then progresses to the management of users, permissions, and basic objects like tables. You will be taught about the Data Definition Language and the most common and useful statements and commands, as well as all the essential relational database concepts, like foreign keys, triggers, and functions. Later, you will explore how to configure and tune your cluster to get the best out of your PostgreSQL service, how to create and manage indexes for fast data retrieval, and how to make and restore backup copies of your data. Lastly, you will learn how to create your own high-availability solution by means of replications, either physical or logical, and you will get a look at some of the most common and useful tools and extensions that you can apply to your cluster.

By the end of this book, you’ll be well versed in the PostgreSQL database and be able to set up your own PostgreSQL instance and use it to build robust, data-centric solutions to real-world problems.