0

Wishing you all a Happy and Prosperous New Year!

I am getting below error while restoring postgres database to a specific target time (PITR):

Invalid value for parameter recovery_target_time in file postgresql.conf

And database is not getting restored. I have tried following values for recovery_target_time:

recovery_target_time = '2022-12-31 12:45:00 UTC'
recovery_target_time = '2022-12-31 12:45:00 UTC+00'
recovery_target_time = '2022-12-31 12:45:00 UTC+00:00'
recovery_target_time = '2022-12-31 12:45:00 Etc/UTC'
recovery_target_time = '2022-12-31 12:45:00.000'

But none of the above is working. What value should be used for recovery_target_time?. I am using postgresql 14 on Ubuntu 22.04 and trying restore database using pg_basebackup. Timezone is in UTC. Let me know if I need to add more details.

Update: Provided logs


2022-12-30 13:32:19.686 UTC [34563] LOG: invalid value for parameter "recovery_target_time": "2022–12–30 12:45:00 UTC+00:00"

neil
  • 1
  • 2
  • It should be `recovery_target_time = '2022-12-31 12:45:00 UTC'`, not `recovery_target_time " '2022-12-31 12:45:00 UTC'`. – Laurenz Albe Dec 31 '22 at 07:32
  • Thanks Laurenz for the response. Using '=' sign only. I miss typed here. I have updated my query. – neil Dec 31 '22 at 08:46
  • Can you share your basebackup command ? – sami lekesiz Dec 31 '22 at 10:53
  • Thanks sami for the response. I think basebackup command is okay. Because am able to create other servers(standby)using basebackup. Restoration is okay without recovery_target_time parameter. – neil Dec 31 '22 at 10:57
  • Please edit the question and add the lines from the PostgreSQL log that stem from the attempted recovery. – Laurenz Albe Dec 31 '22 at 12:18
  • I don't see anywhere in the source code which generate that error message exactly as quoted. Did you paraphrase that? – jjanes Dec 31 '22 at 19:58
  • @LaurenzAlbe added logs to query. Please check if this can help us to troubleshoot the issue. Thanks. – neil Dec 31 '22 at 22:24
  • That `"` looks fishy. Are you sure it was like that in the log file? – Laurenz Albe Jan 01 '23 at 12:22
  • 1
    Issue resolved after using following parameter: recovery_target_time = '2022-12-31 12:45:00+00' – neil Jan 08 '23 at 14:51

0 Answers0