On Wed, Jul 1, 2020 at 04:27:58PM -0400, David Steele wrote:
> On 7/1/20 3:58 PM, Robert Haas wrote:
> > If we could jigger things so that you don't need to stop the backup at
> > all, you only start it, and whether you ever finish copying everything
> > is something about which the system need not know or care, that would
> > be a lot nicer. I'm not sure I see how to do that, though.
>
> Well, the only thing pg_stop_backup() *really* needs to know is the starting
> WAL position. pg_start_backup() gets that info so if it passes it back to
> pg_stop_backup() that could be enough. Or as was proposed above, it just
Doesn't pg_start_backup already return this?
SELECT pg_start_backup('test');
pg_start_backup
-----------------
--> 0/2000028
> Here's a thought. What if we just stored the oldest starting LSN and a count
> of how many backups have been requested. When the backup ends it checks that
> backup count is > 0 and starting LSN is <= its starting LSN. If not, it
> throws an error. When backups go to 0 FPWs are turned off if they were off
> before the first backup.
Can't we just error out of an exclusive-style backup is requested to
start and a previous exclusive-style backup has not been stopped?
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee