Re: Can I pause the pg_dump or pg_restore - Mailing list pgsql-general

From Jasen Betts
Subject Re: Can I pause the pg_dump or pg_restore
Date
Msg-id gv3add$bov$2@reversiblemaps.ath.cx
Whole thread Raw
In response to Can I pause the pg_dump or pg_restore  ("Chen, Dongdong (GE Healthcare)" <DongdongChen@ge.com>)
List pgsql-general
On 2009-05-20, Chen, Dongdong (GE Healthcare) <DongdongChen@ge.com> wrote:
> This is a multi-part message in MIME format.
>
> In my application, when press button "Backup" in UI, it invokes pg_dump
> to backup the database. It may take few minutes for the whole process.
> If I want to pause the process, what should I do. And also how to resume
> the process? Can I pause while pg_restore?

POSIX has SIGSTOP and SIGCONT. you could send them to the pg_dump task
using kill() if you have permission (invoker does) and its PID.

as others have you can also force the process to pause by throttleing it's
I/O.

if you invoke pg_dump using popen() (or similar)
when you stop reading the output pg_dump will (after filling the
buffer) also stop and wait for you to resume reading.

the converse is true when restoring.

Windows may have similar features available, no doubt with different
names and APIs.

pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Can not decompress a compressed string under plpy!
Next
From: Jasen Betts
Date:
Subject: Re: Can I pause the pg_dump or pg_restore