PostgreSQL Tutorial

PostgreSQL Tutorial: Audit through Logging

Summary: in this tutorial, you will learn how to setup audit logging in PostgreSQL.

Continue reading

PostgreSQL Tutorial: Setting up Slow Query Logging

Summary: in this tutorial, you will learn how to setup slow query logging in PostgreSQL.

Continue reading

PostgreSQL Tutorial: Query analysis using pg_stat_statements

Summary: The pg_stat_statements extension exposes a lot of query statistics that will be helpful in finding slow queries that need to be optimized. In this tutorial, we shall see some example queries to view some information from pg_stat_statements.

Continue reading

PostgreSQL Tutorial: Setting up Logical Replication

Summary: Built-in logical replication and logical decoding were introduced in PostgreSQL 10. Over a period of time, more and more features are being implemented within logical replication. It is helpful when a selected list of tables needs to be replicated from multiple OLTP databases to a single OLAP database for reporting and analysis.

Continue reading

PostgreSQL Tutorial: Setting up Streaming Replication

Summary: Streaming replication (physical replication), which is byte-by-byte replication, involves a continuous application of WAL records from Primary to Standby. As it uses a file-based log shipping method, it is one of the fastest replication methods when compared with logical replication or other trigger-based methods.

Continue reading

PostgreSQL Tutorial: Backing up a database cluster using pg_basebackup

Summary: pg_basebackup is the built-in binary format backup tool available with PostgreSQL. Only the backups taken using pg_basebackup can be used for point-in-time recovery and not pg_dump or pg_dumpall.

Continue reading

PostgreSQL Tutorial: Restoring a backup taken using pg_basebackup

Summary: In the backing up a database cluster tutorial, we discussed how pg_basebackup can be used to take a physical backup of the PostgreSQL cluster. We may restore this backup in various situations, such as creating a standby server in replication or recovering a database to a point in time. In this tutorial, we shall see the steps required to restore a backup taken using pg_basebackup.

Continue reading

PostgreSQL Tutorial: Minor Version Update

Summary: In this tutorial, we shall see how a minor version upgrade can be performed when using PostgreSQL 13.

Continue reading

PostgreSQL Tutorial: Install PostgreSQL on Linux using yum

Summary: in this tutorial, you will learn how to download and install PostgreSQL on Linux using yum.

Continue reading