Re: Proposal for Recover mode in pg_ctl (in 8.0) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal for Recover mode in pg_ctl (in 8.0)
Date
Msg-id 17989.1099786612@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal for Recover mode in pg_ctl (in 8.0)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal for Recover mode in pg_ctl (in 8.0)  (Mark Kirkwood <markir@coretech.co.nz>)
Re: Proposal for Recover mode in pg_ctl (in 8.0)  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
I wrote:
> A possibly more reliable interlock would involve having the postmaster
> probe during normal startup to see if there is already an archived WAL
> segment for what it thinks is the current segment.

Another and simpler way is to recommend that people use archive_command
strings that won't overwrite an existing archive file.

For instance instead of showing the example
archive_command = 'cp %p /mnt/server/archivedir/%f'
we could show
archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
or on some machines
archive_command = 'cp -i %p /mnt/server/archivedir/%f </dev/null'

One tricky point is to make sure that the command will return nonzero
status if the target exists.  In some quick testing I found that
the "cp -i" method doesn't have portable behavior on this point.
I think that the "test" method is portable across Unixen, but no idea
what to do on Windows.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Proposal for Recover mode in pg_ctl (in 8.0)
Next
From: Greg Stark
Date:
Subject: Re: Increasing the length of pg_stat_activity.current_query...