Fix incorrect archive truncation point calculation in the %r recovery_command
authorHeikki Linnakangas <heikki@enterprisedb.com>
Fri, 9 May 2008 14:28:08 +0000 (14:28 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Fri, 9 May 2008 14:28:08 +0000 (14:28 +0000)
commitdec46b5fe121ab5d297dd8f097f61299a2ba7419
tree38d6f0d7f38efb60c172e7ddc29827f9dc1731f5
parent321df27f7a10622ce68ddbcf318bdcf1b4c987e5
Fix incorrect archive truncation point calculation in the %r recovery_command
parameter. This fixes bug 4137 reported by Wojciech Strzalka, where a WAL
file is deleted too early when starting the recovery of a warm standby server.

Also add a sanity check in pg_standby so that it will refuse to delete anything
earlier than the file being restored, and improve the debug message in case
nothing is deleted.

Simon Riggs. Backpatch to 8.3, which is where %r was introduced.
contrib/pg_standby/pg_standby.c
src/backend/access/transam/xlog.c