Book Image

PostgreSQL 13 Cookbook

By : Vallarapu Naga Avinash Kumar
Book Image

PostgreSQL 13 Cookbook

By: Vallarapu Naga Avinash Kumar

Overview of this book

PostgreSQL has become the most advanced open source database on the market. This book follows a step-by-step approach, guiding you effectively in deploying PostgreSQL in production environments. The book starts with an introduction to PostgreSQL and its architecture. You’ll cover common and not-so-common challenges faced while designing and managing the database. Next, the book focuses on backup and recovery strategies to ensure your database is steady and achieves optimal performance. Throughout the book, you’ll address key challenges such as maintaining reliability, data integrity, a fault-tolerant environment, a robust feature set, extensibility, consistency, and authentication. Moving ahead, you’ll learn how to manage a PostgreSQL cluster and explore replication features for high availability. Later chapters will assist you in building a secure PostgreSQL server, along with covering recipes for encrypting data in motion and data at rest. Finally, you’ll not only discover how to tune your database for optimal performance but also understand ways to monitor and manage maintenance activities, before learning how to perform PostgreSQL upgrades during downtime. By the end of this book, you’ll be well-versed with the essential PostgreSQL 13 features to build enterprise relational databases.
Table of Contents (14 chapters)
12
About Packt

Locating the Postgres configuration file

A Postgres configuration file can exist in any location. It defaults to the data directory in the CentOS or RedHat family of operating systems and defaults to /etc/postgresql/${pg_major_version}/main in Debian/Ubuntu operating systems, where pg_major_version is the major version of PostgreSQL that is installed. For PostgreSQL 12, it looks like /etc/postgresql/12/main/postgresql.conf. However, it is easier to modify the default location and store it in a different location. In this recipe, we will discuss how to locate the postgresql.conf configuration files that's created for a specific PostgreSQL instance.

Getting ready

To locate the configuration file, we must either have an already running PostgreSQL server or an existing data directory, using which PostgreSQL would have been initialized or started/running already.

How to do it...

Follow these steps to complete this recipe:

  1. Search for the value set of the config_file parameter:
$ psql...