38,39 €
Starting with new features introduced in PostgreSQL 17, the sixth edition of this book provides comprehensive insights into advanced database management, helping you elevate your PostgreSQL skills to an expert level. Written by Hans-Jürgen Schönig, a PostgreSQL expert with over 25 years of experience and the CEO of CYBERTEC PostgreSQL International GmbH, this guide distills real-world expertise from supporting countless global customers. It guides you through crucial aspects of professional database management, including performance tuning, replication, indexing, and security strategies.
You’ll learn how to handle complex queries, optimize execution plans, and enhance user interactions with advanced SQL features such as window functions and JSON support. Hans equips you with practical approaches for managing database locks, transactions, and stored procedures to ensure peak performance. With real-world examples and expert solutions, you'll also explore replication techniques for high availability, along with troubleshooting methods to detect and resolve bottlenecks, preparing you to tackle everyday challenges in database administration.
By the end of the book, you'll be ready to deploy, secure, and maintain PostgreSQL databases efficiently in production environments.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 638
Veröffentlichungsjahr: 2024
Mastering PostgreSQL 17
Elevate your database skills with advanced deployment, optimization, and security strategies
Hans-Jürgen Schönig
Copyright © 2024 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Apeksha Shetty
Publishing Product Manager: Chayan Majumdar
Book Project Manager: Aparna Nair
Senior Editor: Rohit Singh
Technical Editor: Rahul Limbachiya
Copy Editor: Safis Editing
Proofreader: Rohit Singh
Indexer: Tejal Soni
Production Designer: Gokul Raj S.T
DevRel Marketing Executive: Nivedita Singh
First published: January 2018
Second edition: October 2018
Third edition: November 2019
Fourth edition: November 2020
Fifth edition: January 2023
Sixth edition: December 2024
Production reference: 1061224
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK.
ISBN 978-1-83620-597-5
www.packtpub.com
Hans-Jürgen Schönig has 25 years of experience with PostgreSQL. He is the CEO of a PostgreSQL consulting and support company called CYBERTEC PostgreSQL International GmbH, which has successfully served countless customers around the globe. Before founding CYBERTEC PostgreSQL International GmbH in 2000, he worked as a database developer at a private research company that focused on the Austrian labor market, where he primarily worked on data mining and forecast models. He has also written several books about PostgreSQL.
Rajneesh Verma is a seasoned technology leader with over 18 years of experience, currently heading IT and security at CYBERTEC PostgreSQL Services. Specializing in enterprise design and architecture, he is passionate about building reliable platforms, including database-as-a-service solutions and innovative setups for cloud and on-premises environments, IAAS, PAAS, and security. His technical stack includes PostgreSQL, SQL Server, Python, Flask, HTML, and CSS. Curious by nature, Rajneesh loves figuring out “how things work” and shares this enthusiasm through book reviews, exploring tech, leadership, and innovation with technical depth and approachable storytelling.
Welcome to Mastering PostgreSQL 17, the ultimate guide to unlocking the full potential of one of the world’s most popular open source relational databases – PostgreSQL. With decades of history and a community-driven development process, PostgreSQL has become the go-to choice for organizations seeking a robust, scalable, and reliable database solution. This has been true for many years and this will be the case for many years to come.
In this book, we’ll take you on a comprehensive journey through the latest features and enhancements in PostgreSQL 17, the newest major release of the database system. Whether you’re a seasoned DBA looking to expand your skillset or a developer seeking to improve your application’s performance and scalability, this book is designed to help you master the art of working with PostgreSQL and it will hopefully be an enjoyable thing to read that helps you to understand things better, be more productive, and simply have a better time.
Mastering the art of handling data is an ever more important skill that is important to have. In a digital world, “data” is more or less the “new oil” – an important asset that drives the world and the importance of data is growing as we speak. Every sector of IT is data-driven. It does not matter whether you are at the forefront of machine learning or whether you are working on bookkeeping software – at the end of the day, IT is all about data.
PostgreSQL has become a hot technology in the area of open source, and it is an excellent technology to store and process data in the most efficient way possible. This book will teach you how to use PostgreSQL in the most professional way and explain how to operate, optimize, and monitor this core technology, which has become so popular over the years.
By the end of the book, you will be able to use PostgreSQL to its utmost capacity by applying advanced technology and cutting-edge features.
This book is tailored for database administrators, PostgreSQL developers, and IT professionals aiming to implement advanced functionalities and tackle complex administrative tasks using PostgreSQL 17. A foundational understanding of PostgreSQL and core database concepts is essential, along with familiarity with SQL. Prior experience in database administration will enhance your ability to leverage the advanced techniques discussed throughout the book.
Chapter 1, What is New in PostgreSQL 17, guides you through the most important features that have made it into the new release of PostgreSQL and explains how those features can be used.
Chapter 2, Understanding Transactions and Locking, explains the fundamental concepts of transactions and locking. Both topics are key requirements to understand storage management in PostgreSQL.
Chapter 3, Making Use of Indexes, introduces the concept of indexes, which are the key ingredient when dealing with performance in general. You will learn about simple indexes as well as more sophisticated concepts.
Chapter 4, Handling Advanced SQL, unleashes the full power of SQL and outlines the most advanced functionality a query language has to offer. You will learn about windowing functions, ordered sets, hypothetical aggregates, and a lot more. All those techniques will open a totally new world of functionality.
Chapter 5, Log Files and System Statistics, explains how you can use runtime statistics collected by PostgreSQL to make operations easier and to debug the database. You will be guided through the internal information-gathering infrastructure.
Chapter 6, Optimizing Queries for Good Performance, is all about good query performance and outlines optimization techniques that are essential to bringing your database up to speed to handle even bigger workloads.
Chapter 7, Writing Stored Procedures, introduces you to the concept of server-side code such as functions, stored procedures, and a lot more. You will learn how to write triggers and dive into server-side logic.
Chapter 8, Managing PostgreSQL Security, helps you to make your database more secure and explains what can be done to ensure safety and data protection at all levels.
Chapter 9, Handling Backup and Recovery, helps you to make copies of your database to protect yourself against crashes and database failure.
Chapter 10, Making Sense of Backups and Replication, follows up on backups and recovery and explains additional techniques, such as streaming replication, redundancy, and a lot more. It covers the most advanced topics.
Chapter 11, Deciding on Useful Extensions, explores extensions and additional useful features that can be added to PostgreSQL.
Chapter 12, Troubleshooting PostgreSQL, completes the circle of topics and explains what can be done if things don’t work as expected. You will learn how to find the most common issues and understand how problems can be fixed.
Chapter 13, Migrating to PostgreSQL, teaches you how to move your databases to PostgreSQL efficiently and quickly. It covers the most common database systems people will migrate from.
This book has been written for a broad audience. However, some basic knowledge of SQL is necessary to follow along and make full use of the examples presented. In general, it is also a good idea to familiarize yourself with basic Unix commands as most of the book has been produced on Linux and macOS.
Software/hardware covered in the book
Operating system requirements
pgAdmin4
Windows, macOS, or Linux
PostgreSQL 17
SQL Shell (psql)
Note
Some parts of chapters, that is, 8, 9, 10, 11, 12, and 13 are mostly dedicated to Unix/Linux and macOS users, and the rest run fine on Windows.
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “The community has removed this feature and introduced a new variable called transaction_timeout, which can be set per session.”
A block of code is set as follows:
CREATE OR REPLACE FUNCTION on_login_proc() RETURNS event_trigger AS $$ BEGIN INSERT INTO user_lo (w) VALUES (SESSION_USER); RAISE NOTICE 'You are welcome!'; END; $$ LANGUAGE plpgsql;When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
test=# SHOW event_triggers; event_triggersAny command-line input or output is written as follows:
test=# CREATE TABLE t_data ( id int, data text );Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “A new process called summarizer was added to PostgreSQL.”
Tips or important notes
Appear like this.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Once you’ve read Mastering PostgreSQL 17 – Sixth Edition, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.
Thanks for purchasing this book!
Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?
Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.
Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.
The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily
Follow these simple steps to get the benefits:
Scan the QR code or visit the link belowhttps://packt.link/free-ebook/978-1-83620-597-5
Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly