After taking a look at the big picture, we can take a look and see how things can be put to work.
The first thing you have to do when it comes to Point-In-Time-Recovery is to archive the XLOG. PostgreSQL offers all the configuration options related to archiving through postgresql.conf
.
Let us see step by step what has to be done in
postgresql.conf
to start archiving:
First of all, you should turn
archive_mode
on.In the second step, you should configure your
archive
command. Thearchive
command is a simple shell command taking two parameters:%p
: This is a placeholder representing the XLOG file that should be archived, including its full path (source).%f
: This variable holds the name of the XLOG without the path pointing to it.
Let us set up archiving now. To do so, we should create a place to put the XLOG. Ideally, the XLOG is not stored on the same hardware as the database instance you want to archive. For the sake of this example, we assume that we want to apply...