Thread: How to tell if server is in backup mode?

How to tell if server is in backup mode?

From
Toby Corkindale
Date:
Hi,
I can start and stop backup mode with pg_start_backup() and
pg_stop_backup().

Is there any function like pg_is_in_backup() to tell if the mode has
been enabled?

(I can't find anything in the 9.1 docs)

Cheers,
Toby

Re: How to tell if server is in backup mode?

From
Gabriele Bartolini
Date:
Hi Toby,

Il 28/03/12 09:14, Toby Corkindale ha scritto:
> Is there any function like pg_is_in_backup() to tell if the mode has
> been enabled?

Currently, there's no such a function. In general we simply check if a
'backup_label' file exists in PGDATA. However, it could be a good idea
to add it as admin function (I will have a think about it and possibly
come up with a patch).

Ciao,
Gabriele

--
  Gabriele Bartolini - 2ndQuadrant Italia
  PostgreSQL Training, Services and Support
  gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it


Re: How to tell if server is in backup mode?

From
Gabriele Bartolini
Date:
Hi Toby,

Il 29/03/12 10:46, Gabriele Bartolini ha scritto:
> Currently, there's no such a function. In general we simply check if a
> 'backup_label' file exists in PGDATA. However, it could be a good idea
> to add it as admin function (I will have a think about it and possibly
> come up with a patch).
My bad (thanks Carlo Ascani for pointing this out to me). Gilles Darold
just proposed such a patch and I looked into the commitfest website:
https://commitfest.postgresql.org/action/patch_view?id=803

I just added myself as a reviewer for PostgreSQL 9.3.

Cheers,
Gabriele

--
  Gabriele Bartolini - 2ndQuadrant Italia
  PostgreSQL Training, Services and Support
  gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it


Re: How to tell if server is in backup mode?

From
Toby Corkindale
Date:
On 29/03/12 19:50, Gabriele Bartolini wrote:
> Hi Toby,
>
> Il 29/03/12 10:46, Gabriele Bartolini ha scritto:
>> Currently, there's no such a function. In general we simply check if a
>> 'backup_label' file exists in PGDATA. However, it could be a good idea
>> to add it as admin function (I will have a think about it and possibly
>> come up with a patch).
> My bad (thanks Carlo Ascani for pointing this out to me). Gilles Darold
> just proposed such a patch and I looked into the commitfest website:
> https://commitfest.postgresql.org/action/patch_view?id=803
>
> I just added myself as a reviewer for PostgreSQL 9.3.

Cool, good to know it's on its way :)

Thanks Gabriele,

Toby