Re: backup.old - Mailing list pgsql-general

From Scott Mead
Subject Re: backup.old
Date
Msg-id 1444247189898-d0739f55-ca22542a-4fa76335@openscg.com
Whole thread Raw
In response to Re: backup.old  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general

On Wed, Oct 7, 2015 at 15:38, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Oct 7, 2015 at 3:29 PM, Steve Pribyl <Steve.Pribyl@akunacapital.com> wrote:

Thank you very much. I read someplace if you run pg_start_backup twice the backup.old will be created, but there was not much beyond that and now I can't seem to find the reference.


backup_label gets deleted on pg_stop_backup() on the *master*. 

Backup_label will still be in the *backup* itself however (or, more succinctly, a slave server). When you start the backup / slave, it will process backup_label so that it can start recovery. Once we don't need it anymore, the file is renamed to backup_label.old.  Typically, when you see a backup_label.old on a writable master, it was either:
* a backup that was restored and put in to service
* a slave server that was promoted 
  A pg_controldata will probably show a timeline !=  1


​Scanning the docs and logic tells me that attempting to do pg_start_backup twice in a row should result in the second attempt giving an error...but I could be misinformed.

The file pg_start_backup creates is named "backup_label" and so I'd also expect any attempt to add an old suffix would keep the same base name...

David J.​

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to drop user if objects depend on it
Next
From: droberts
Date:
Subject: Re: Best practices for aggregate table design