Is there a way to let PostgreSQL restore but not create a new timeline

1

I'm using PostgreSQL 8.4 and am creating a standby server. Since PostgreSQL 8.4 doesn't have built-in replication support, I did the following things try to get read only access to the standby server, and not to transfar full backup everyday.

  • Set master to transfer WAL files to the standby server in postgresql.conf

    archive_mode = on  
    archive_command = 'scp -C %p standby:/var/lib/pgsql/backups/%f'
    
  • create a recovery.conf on the standby server

    restore_command = 'mv /var/lib/pgsql/backups/%f %p'
    recovery_end_command = 'mv /var/lib/pgsql/data/recovery.{done,conf}'
    
  • pg_ctl restart -m fast once a day

Then I realized that PostgreSQL did restore the transfered WAL files at the initial start up, but does not after a restart. I found the next message in the log file.

LOG: selected new timeline ID: 2

It seems that standby server is already on a new timeline, but master server is still sending old timeline's WAL file, which makes standby server not restoring.

So is there a way to make it possible to achieve what I'm trying to do?

Thanks.

user218669

Posted 2015-03-26T07:33:44.750

Reputation: 11

sDid you promote the standby at some point? It can't replay the \ – Craig Ringer – 2015-03-26T07:49:38.327

It reads like you'd want to continue restoring into a secondary server that at some point has become a live server? That's not possible because as soon as the end of the recovery, it is allowed to diverge irrevocably from the primary. The new timeline is just a sign indicating that. – Daniel Vérité – 2015-03-27T21:27:36.087

No answers