Book Image

PostgreSQL 10 Administration Cookbook - Fourth Edition

Book Image

PostgreSQL 10 Administration Cookbook - Fourth Edition

Overview of this book

PostgreSQL is a powerful, open source database management system with an enviable reputation for high performance and stability. With many new features in its arsenal, PostgreSQL 10 allows users to scale up their PostgreSQL infrastructure. This book takes a step-by-step, recipe-based approach to effective PostgreSQL administration. Throughout this book, you will be introduced to these new features such as logical replication, native table partitioning, additional query parallelism, and much more. You will learn how to tackle a variety of problems that are basically the pain points for any database administrator - from creating tables to managing views, from improving performance to securing your database. More importantly, the book pays special attention to topics such as monitoring roles, backup, and recovery of your PostgreSQL 10 database, ensuring high availability, concurrency, and replication. By the end of this book, you will know everything you need to know to be the go-to PostgreSQL expert in your organization.
Table of Contents (14 chapters)

Encrypting sensitive data

This recipe shows you how to encrypt data using the pgcrypto contrib package.

Getting ready

Make sure you (and/or your database server) are in a country where encryption is not illegal-it still is in some countries.

In order to create and manage PGP keys, you also need the well-known GnuPG command-line utility, which is available on practically all distributions.

pgcrypto is part of the contrib collection. Starting from version 10, on Debian and Ubuntu is part of the main postgresql-10 server package, while in previous versions there was a separate package, for example, postgresql-contrib-9.6.

Install it on the database in which you want to use it, following the Adding an external module to PostgreSQL...