Check PITR readiness
check_pitr_readinessAssesses PostgreSQL cluster readiness for point-in-time recovery by verifying archiving, wal_level, max_wal_senders, and full_page_writes, returning readiness status and remediation for failing gates.
Instructions
Assess whether the cluster is ready for point-in-time recovery (PITR) — the one-call 'could I actually recover to an arbitrary point right now, and if not what's missing?' check. Composes get_wal_archive_status (5.2) with the GUCs that gate PITR: continuous archiving must be healthy, wal_level >= replica, max_wal_senders >= 1 (so pg_basebackup can stream a base backup), and full_page_writes on (torn-page safety during replay). Read-only advisor — changes nothing, emits no secrets. Returns an object with available, ready (bool — true only when all gates pass), wal_level, archiving_healthy, gates (list of objects with name, ok, observed, remediation), remediation (ordered fixes for failing gates), and detail.
Example: check_pitr_readiness()
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gates | Yes | ||
| ready | Yes | ||
| detail | No | ||
| available | Yes | ||
| wal_level | Yes | ||
| remediation | Yes | ||
| archiving_healthy | Yes |