Skip to content

Restore PITR backup doc hints wrong datetime format. #1625

@taurus-forever

Description

@taurus-forever

Steps to reproduce

Following the guide: https://canonical-charmed-postgresql.readthedocs-hosted.com/16/how-to/back-up-and-restore/restore-a-backup/#restore-backup

juju run postgresql/leader restore restore-to-time="YYYY-MM-DDTHH:MM:SSZ"

I have tried to use PITR (point-in-time-recovery):

> juju run postgresql/2 restore restore-to-time="2026-04-14T09:40:20Z"                                                                                                                                                                  
Running operation 198 with 1 task                                                                                                                                                                                                                             
  - task 199 on unit-postgresql-2                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                              
Waiting for task 199...                                                                                                                                                                                                                                       
Action id 199 failed: Bad restore-to-time format                

While the correct/expected by code and tested by integration test is the one matching SELECT current_timestamp:

test123=> SELECT current_timestamp;
       current_timestamp       
-------------------------------
 2026-04-14 11:57:27.955814+00
(1 row)

test123=> 

And it works well:

> juju run postgresql/2 restore restore-to-time="2026-04-14 09:40:20"                                                                                                                                                                   
Running operation 204 with 1 task                                                                                                                                                                                                                             
  - task 205 on unit-postgresql-2                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                              
Waiting for task 205...                                                                                                                                                                                                                                       
restore-status: restore started   

Please update documentation accordingly.
Both manuals PG14 and PG16 are affected.
Please check/fix both VM and K8s charms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions