Re: Can I pause the pg_dump or pg_restore

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can I pause the pg_dump or pg_restore
Date: 2009-05-21 10:29:01
Message-ID: gv3add$bov$2@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-05-20, Chen, Dongdong (GE Healthcare) <DongdongChen(at)ge(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2009-05-21 10:33:01 Re: Can I pause the pg_dump or pg_restore
Previous Message Gerhard Wiesinger 2009-05-21 10:16:30 Re: HOT question - insert/delete