Answer the question
In order to leave comments, you need to log in
Why can't I restore a PostgreSQL cluster from a WAL backup?
astra linux 1.6, postgresql 9.6
for the sake of testing, I want to check how the recovery via WAL works;
initially there is a copy of the entire cluster, it is restored normally,
then I make some changes to the database
, I copy the only WAL file (let it be called 0001) from the /var/lib/ directory postgresql/9.6/main/pg_xlog with the usual cp command with the -p flag, so that postgres remains the owner, into the new /main/wal directory,
then I restore the entire cluster from the files, so there are no changes made,
now, just in case, I delete the WAL file from pg_xlog
after I create recovery.conf file in main with the command:
restore_command = 'cp -f /var/lib/postgresql/9.6/main/wal/0001%p'
and turn on the server accordingly
it seems like the recovery is going on:
but then the following records begin:
Answer the question
In order to leave comments, you need to log in
In general, I did so far as in the documentation
https://postgrespro.ru/docs/postgresql/9.6/continu...
through normal archiving . It
worked
, but the question remains open. You
can’t manually copy the WAL files yourself and then recover through them?
it's just strange that it works with cluster files, but doesn't want to with WAL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question