1

I try to recover a barman backup, and I want to use the parameter target-time. But barman does not accept this parameter, even if I use it in the same manner like many sources I found. The whole output:

barman@BKUP-XXX:~$ barman recover --target-time '2023–04–22 00:00:00.000000+02:00' --remote-ssh-command "ssh postgres@pgdb-XXX" PGDB-XXX 20230416T214125 /var/lib/postgresql/13/main/
Starting remote restore for server PGDB-XXX using backup 20230416T214125
Destination directory: /var/lib/postgresql/13/main/
Remote command: ssh postgres@pgdb-XXX
ERROR: Unable to parse the target time parameter '2023–04–22 00:00:00.000000+02:00': Unknown string format: 2023–04–22 00:00:00.000000+02:00
barman@BKUP-XXX:~$

The string format of the time is unknown. But it's exactly the format used in many examples, no matter if with or without milliseconds or timezone, every time I try is unknown. Maybe it's a python issue? The server is used only for barman, I don't think, there is another software with interdependencies to barman or python. How can I use the target-time?

Dave_B.
  • 173
  • 10

1 Answers1

0

The --target-time option should accept any timestamp allowed by the PostgreSQL recovery_target_time parameter.

Your particular --target-time value is using en dashes (, UTF-8 code: E2 80 93) instead of hyphens (-, UTF-8 code: 2D). If you replace the dashes with hyphens then the timestamp will be accepted, e.g.: 2023-04-22 00:00:00.000000+02:00.

  • To be honest, I'm not absolutly sure, if this is the correct answer, but ist sounds very plausible. It was strange, next time after a few days I tried the command it worked like expected, and I don't had any clue what was the difference. But maybe I used the wrong hyphens, anf if so, I have no idea, how I got these. I tried it many times, and I used the keyboard, no copy&paste. But I assume, this answer is correct. Thank you! – Dave_B. Aug 25 '23 at 06:20
  • There are definitely some applications out there (google docs I think is one, possibly some wikis) which will auto-format a hyphen as a dash - I've certainly be bitten by that before. – mike wallace Aug 25 '23 at 09:53