Re: Am I missing something about the output of pg_stop_backup()? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Am I missing something about the output of pg_stop_backup()?
Date
Msg-id 4693E88F.2090105@archonet.com
Whole thread Raw
In response to Am I missing something about the output of pg_stop_backup()?  (Ben <bench@silentmedia.com>)
Responses Re: Am I missing something about the output of pg_stop_backup()?  (Ben <bench@silentmedia.com>)
List pgsql-general
Ben wrote:
> So, I'm working on a script that does PITR and basing it off the one here:
>
> http://archives.postgresql.org/pgsql-admin/2006-03/msg00337.php
>
> (BTW, thanks for posting that, Rajesh.)
>
> My frustration comes from the output format of pg_stop_backup().
> Specifically, it outputs a string like this:
>
> 550/E788D70
>
> ...which I then need to tokenize in order to find which archived wal
> files I'll need to keep as part of the backup. For instance, that output
> above will result in a WAL file named like so:
>
> 00000001000005500000000E.00788D70.backup

> 4. Actually.... why doesn't pg_stop_backup() just output the WAL
> filename that was used?

Have you looked in the "backup history file":
http://www.postgresql.org/docs/8.2/static/continuous-archiving.html#BACKUP-BASE-BACKUP

"The backup history file is just a small text file. It contains the
label string you gave to pg_start_backup, as well as the starting and
ending times and WAL segments of the backup. If you used the label to
identify where the associated dump file is kept, then the archived
history file is enough to tell you which dump file to restore, should
you need to do so."

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: "Shuo Liu"
Date:
Subject: exit code -1073741819
Next
From: Richard Huxton
Date:
Subject: Re: vacuumdb: PANIC: corrupted item pointer