Is there a way for barman to determine the latest time for a POIT recovery? I think that barman used to tell you that if you specified a too late time for the recovery, he has no data for it.
Currently barman simply performs the recovery and only when the postgre server is booted, the error message appears that data is missing until the too late time.
Example. The last transaction of the WAL files took place at 13:15. The recovery is performed with the command
barman recover pg_server 20230425T090004 --target-time "2023-05-25 13:30:43" --target-action=promote /pgdata/data/userdata Then barman will do it without any problems. But it is only when the postgres server is booted that the error occurs:
FATAL: recovery ended before configured recovery target was reached
Greetings niesel
Barman does not currently do anything to verify that the requested
--target-timeis actually reachable. There is an existing issue for adding this functionality but no immediate plans to work on it.In the meantime you would need to use pg_waldump to validate for yourself that a given timestamp is reachable from the WALs in Barman's archive. For example if the latest WAL segment in the archive was 000000010000000000000073 then you could find the transaction commit timestamps with:
and then verify that there is at least one transaction committed after your proposed
--target-timevalue.