DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Write-Ahead Log / Recovery Target

recovery_target_time

Sets the time stamp up to which recovery will proceed.

  • Default: '' (empty)
  • Type: string
  • Applies: Restart required

In plain words

The classic point-in-time recovery: "give me the database as it was at 14:04:59". Replay stops at the first transaction that committed after that moment. Use a time just before the mistake you want to undo, and include a time zone.

For DBAs and operators

Format: a timestamp with time zone literal, e.g. '2026-10-22 14:04:59+00'. Without a zone, the server's TimeZone at startup is used: a common source of off-by-hours restores. Only commit and abort records have timestamps, so the stop point is a transaction boundary.

Inclusive (default on): transactions committing exactly at the target time are included; off: replay stops before them. Since a mistake and its commit often share the same second, either pick a time slightly before it or use recovery_target_xid/_lsn, found with pg_waldump:

pg_waldump -p /mnt/archive -s 0/5000000 | grep -i commit

The target must be after the end of the base backup, or recovery fails. If the archive ends before the target: FATAL: recovery ended before configured recovery target was reached

How to change it

Change in postgresql.conf or ALTER SYSTEM, then restart the server.

See it in context

Archiving and point-in-time recovery Startup process

Related parameters

recovery_target_inclusive recovery_target_action recovery_target_xid recovery_target_lsn restore_command

All Write-Ahead Log parameters