Re: Proposal for Recover mode in pg_ctl (in 8.0)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal for Recover mode in pg_ctl (in 8.0)
Date: 2004-11-07 00:16:52
Message-ID: 17989.1099786612@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2004-11-07 00:28:16 Re: Increasing the length of pg_stat_activity.current_query...
Previous Message Mark Kirkwood 2004-11-06 23:46:16 Re: Proposal for Recover mode in pg_ctl (in 8.0)