Posts

Point-in-Time Recovery (PITR) with pg_basebackup in PostgreSQL 18

  pg_basebackup is a useful tool for creating a base backup of a PostgreSQL cluster. When combined with continuous WAL archiving, it can be used to perform Point-in-Time Recovery (PITR) . In this article, I will demonstrate how to create a base backup using pg_basebackup and then perform PITR to a specific point in time. 1. Check the Current PostgreSQL Cluster First, let’s check the current state of the PostgreSQL cluster. psql (18.0) WARNING: Console code page (720) differs from Windows code page (1256) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. Type "help" for help . postgres=# \l List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges -----------+----------+----------+-----------------+-------------...