Re: Detecting if the DB is in backup mode or not

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Adam_Crews(at)mcafee(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Detecting if the DB is in backup mode or not
Date: 2010-06-02 16:02:05
Message-ID: AANLkTinqtc8HwMStGLT_lltqNkceYpOMEOKr-zSjOUIm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2 June 2010 16:28, <Adam_Crews(at)mcafee(dot)com> wrote:
> Hello,
>
>
>
> I am running pg 8.3, and I’m working on some scripts to take online backups
> of the database with backup mode and netapp snapshots.  I can successfully
> run the pg_start_backup/pg_stop_backup functions, but how to I query to see
> what mode the DB currently is in?  If my script fails to run the
> stop_backup, I’d like to have some external monitoring that can alert me to
> the database being stuck in backup mode.
>

When you use pg_start_backup, it creates a file called BACKUP_LABEL in
your data directory. Plus, if you try to call it twice, it'll report
you're already running it if that's at all useful.

If you wish to identify it in a query, see if "SELECT
pg_stat_file('BACKUP_LABEL');" returns anything.

There might be a proper function or catalog table/view for it though,
if someone else knows....

Regards

Thom

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-06-02 16:20:23 Re: server-side extension in c++
Previous Message Peter Geoghegan 2010-06-02 15:49:57 Re: server-side extension in c++