Showing results for 
Search instead for 
Did you mean: 

Bart timeline restoration

Level 2 Adventurer

Bart timeline restoration

I can not find documentation on restoring with a timelineid. When using Bart how do you use the timelineid option? Is it just the timelineid switch or can I combine it with the physical time switch and/or transactionid switch for my PITR.
Community Manager

Re: Bart timeline restoration



BART's 'RESTORE' command has a '-t' switch which can be used to specify timeline_id.

Please reffer to section 5.4.7 of the BART documentaion at the following link:

Hope this is what you are looking for.

Level 2 Adventurer

Re: Bart timeline restoration

It is not what I'm looking for. To directly reference the link you provided, it says Bart will accept invalid options for -t, -x, -g. I am specifically asking for the definitions of "validity". How do you use these options ? Can I use -t and -g together ? What are the options that I can use in conjunction with -t such that I can successfully restore a specific timeline ? And what files are needed for this to happen? Do I need a 00002.history file to restore to a timeline-Id of 2??

Bart is clear. But the Postgres documentation on timeline _id recovery is sparse, vague, and lacking. I'm asking for someone to rectify that.
Level 2 Adventurer

Re: Bart timeline restoration

Bart uses the --target-xid, --target-tli, and --target-timestamp arguments to construct a recovery.conf file.


When the database server starts (after the restore operation completes), the server reads the recovery.conf file and replays the required WAL (write-ahead LOG) files, stopping at the specified point (if you've specified a --target-xid or --target-timestamp).


You can learn more about the recovery.conf file here:


When you invoke bart with the --target-xid option, bart writes a recovery_target_xid to the recovery.conf file.

When you invoke bart with the --target-tli option, bart writes a recovery_target_timeline to the recovery.conf file.

When you invoke bart with the --target-timestamp option, bart writes a recovery_target_time to the recovery.conf file.


Here are a few articles/blogs that you may find helpful:


timelines and history files PostgreSQL 9.1 (

Evolution of Fault Tolerance in PostgreSQL: Time Travel (2nd Quadrant)


 Hope that helps.